This is probably a very noob questions, but when writing compute shaders, is it better to pass your data in as a struct in a single StructuredBuffer or as multiple individual StructuredBuffers of floats? Here's some examples: struct Data{ float DataA; float DataB; float DataC;}; RWStructuredBuffer<Data> MyData; or:…
Please I need your help to figure this out. I have this formula that I have been trying to apply to my project. I use the GoDot engine to create a 2D platformer game with projectiles. static public Vector2 calculate_arc_velocity(Vector2 point_a, Vector2 point_b, float arc_height,float up_gravity=30, float?…
Here is an untested alternative that avoids branching, using the fact that a boolean value can be cast to numeric values in Cg or HLSL. const float a = color.a;float rR = color.r * (float)( a >= 0.66 && a <= 1.0 );float rG = color.g * (float)( a > 0.33 && a < 0.66 );float rB = color.b * (float)( a >= 0.0 && a <= 0.33 );//…
I have a directional light set up and casting shadows disabled on the geometry that is floating but when I render out a picture it still is very obvious it is floating above it. Is their a step i am missing?
You can have as much floating or non floating parts as you want. Some game engines deal with floating parts better than others, so you might have some lighting issues with floating parts. A good start place is anything that moves should be floating and baked seperately. You can have a piece like that as many floating parts…