ID3D10EffectMatrixVariable

Started by
3 comments, last by lomateron 12 years, 1 month ago
Is there any way of changing that (title) inside the hlsl and maintaining it changed or doing something similar, taking a buffer and putting there matrix, vector, etc variables then changing them in the hlsl mantaining the changed info.
Advertisement
ID3D10EffectMatrixVariable is a reference to matrix variable in the shader. So if you change your matrix variable in your shader and don't update it from your program it should be maintaining it's last value.

Edit: I tried it now and I wasn't able to change it in the shader after binded with ID3DEffectVariable. Sorry for the misinformation.
so how do i update it?
No, you can't modify a constant shader input, except by setting it normally (which sets a single constant value for the shader to read).

However, you can use shaders to modify/create a buffer of data by using stream-out ("render" to vertex buffer) or render-targets (render to texture).
e.g. you can use a texture as input to a shader, and have it generate a new texture (render-target) as output.
wait i think i need to describe more, after changing a variable in the hlsl file metods i want that changed variable to be there the next time i use the hlsl(for example the next frame)
ok then i will use the buffer, if i have only three 3D vectors(that i will put in the buffer) what will be faster, using a vertex buffer or a texture buffer

This topic is closed to new replies.

Advertisement