I have created a fake volumetric light shader, and it works fine in the scene view before I click play. After I click play, the shader stops working for some objects and works for others. I set the fan, volumetric cylinder and light to static and the issue still persists. When these objects are non-static, the issue keeps happening on and off as I move in the game.
#Fake volumetric light shader inconsistency
1 messages · Page 1 of 1 (latest)
Show the shader?
What type of static do you mean, and how do you expect it to be related?
like the normal static, the checkmark that is on the top right of the object's inspector
I am not sure how it would be related but its my first time I actually use shaders so I don't exactly know
To clarify do you mean the problem was better or worse with/without the static flags?
The checkbox makes it every type of static, which you can see individually from the dropdown next to it
Batching Static combines the meshes into a shared object space, which may be what's affecting the shader as you use the local object space for the fade
it got worse, the problem is consistently there when it has a static flag. The problem is inconsistent as I move around with my player when its non-static.
I guess it's also possible the _Time variable can overflow and start glitching out
At least in Shader Graph Time keeps counting up all the time when application/editor is running so it can easily run into floating point inaccuracy and start jumping and warping whatever you're using it for
Can I use shader graph in built-in?
Yes at least in the more recent editor versions
However it can't easily do a lot of the bit more advanced stuff that can be done with written shaders, and it can't use built-in RP specific shader methods really
Its advantage is that making URP and HDRP shaders without it is really tough
Nodes are easier to work with, but also using them won't teach you shaders very deeply if learning is your goal
But I'm guessing creating this specific shader in shader graph is kind of easy
So I should try to recreate it in shader graph
That depends on your goals and priorities
If you can use Shader Graph due to not needing BiRP specific features, I wonder why not use URP to start with in this day and age
Its my first game really so I wanted to start right away and not confuse myself with what to pick.
Valid reasoning
Though in my opinion URP is more beginner friendly than BiRP, and less confusing due to being officially well supported
I really wanted to create a lot of things and use assets from the asset store in my project but some of these things are only possible in URP so I guess im sticking with URP after im done with that game.
I finally fixed it by disabling dynamic batching in the shader. I added the tag {"DisableBatching" = "True"}
Didn't even know dynamic batching was something you had to worry about
Not very beginner friendly
True I have been trying to fix it for 5 hours now lol
URP would automate those kinds of things for you
You could also just not use object space coords