So I just want to get started writing/understanding shaders a bit. I saw on youtube an Acerola video about shell-texturing, saying this was a good simple start.
I started from the Bevy example shader-material and sure enough this was pretty simple at first and I have now a shell texuring material that works. But some other things I cannot really figure out by the examples and documentation (my inexperience in the domain probably has the biggest blame in this).
How do I avoid (optionally), back face culling?
I also want to pass some boolean to the shader (like a parameter to configure if the strands should be conical or pyramidal). I have this working but passing a single bool as a u32. How can I pass multiple booleans to the shader as a single u32 bitset?
For the moment, If the material is supposed to have X shells, I spawn X entities. With a material parameter telling which shell index it represent. I want to spawn just a single mesh without this shell_index parameter in the material. My first instinct was to look into geometry shaders to do that. But apparently it is not supported in Bevy. Probably, GPU instancing would be possible/better. There is an example for that. What do you recommend to try?
I want to pass other variables (uniforms?) to the shader that are not part of the material. Something like the wind direction (coming from a resource) and the entity movement (coming from a system). Can you point to were I can look to figure how to pass that information to the shader?
For the moment there is no shading. I could implement that by making the material an extension to the StandardMaterial like in the extended-material example and I will probably do that in the future. But for the moment (for the learning experience) I want to do a simple lambert shading myself. How can I access the lights information in the shader to do that?
Thanks, and sorry, I know this is a bit too much to ask in a single help post. :/