top of page

Learning shader programming for Unity day 1

  • Writer: Asante Azevedo
    Asante Azevedo
  • Nov 11, 2022
  • 1 min read

Updated: Nov 13, 2022

I was working on a small game where the player is raking leaves, when I was having issues with my leaf material. I had made a quad and a .png of a leaf with an alpha channel that would create a mask for the leaf. I wrote some basic shader code to turn the mask transparent. Each leaf was a mesh renderer with the lead material applied to a quad. This was working fine, but then I noticed that the shadows weren't right. I realized that the whole quad was casting a shadow instead of just the leaf.

After doing some research, I realized that I would have to learn to write my own shader that incorporates lighting and shadows. This lead me down the rabbit hole of shaders. I have some experience with shaders. I found this really awesome website for shaders called thebookofshaders.com. This website goes in-depth about the basics of shaders and how to use the basics to make some awesome stuff. Unfortunately this didn't cover anything about lighting or shadows. I found some other blogs and tutorials that had walkthroughs about shaders in unity. Catlikecoding is where I'm going to be learning how to make a leaf shader that has appropriate lighting and shadows.

Currently I'm working on the lighting part. Here's what I have so far.



Recent Posts

See All

Comments


© 2020 by ASANTE AZEVEDO. Proudly created with Wix.com

bottom of page