Hello. I have already posted a thread about myself and what I am trying to accomplish here. TLDR: I am a 12 year, game industry, artist moving into graphics programming, starting with hlsl shader development. I started with a basic phong shader and received a ton of help on these forums here. Now I continue my journey and am starting a new thread with general questions. I am using several books and online resources in my process but sometimes community is a great way to learn as well.
Here we go!
Question #1:
I understand that there are global variables and local variables. If you want to use a declared, global. variable in a function (like a vertex shader) you need to pass it in. I usually create a struct that I want to use in the vertex shader for this reason. However, I have noticed that some variables (like, worldViewProjection : WORLDVIEWPROJECTION) can be declared and used in a function without being passed into it. Why is that? What am I missing here?