Hi,
I have shader with uniform inputs for whole object, like Position and Scale.
In OpenGL I used glUniform* functions to pass those values into my struct inside shaders.
Now I moving this stuff under D3D11 and I'm not sure if its good idea to have one constant buffer per object?
My simple frame logic is:
- Update global constant buffer (map, write, unmap)
- Time
- MVP
- Foreach game objects
- Call update method which will modify position and scale on CPU side
- Map constant buffer (which is already created when object is spawned to the scene)
- Copy CPU position and scale to constant buffer
- Unmap
- Draw
Is good idea to have one constant buffer per object? Or do I have to use one global constant buffer and just update values for every new object?
Thank you