Why isn't my other two constant buffers being updated to the shader?
Posted
by
Paul Ske
on Game Development
See other posts from Game Development
or by Paul Ske
Published on 2013-11-01T03:53:52Z
Indexed on
2013/11/01
4:19 UTC
Read the original article
Hit count: 234
directx
I posted previously before about my two dynamic buffers not being dynamically updating the constant shader. The tessellation buffer isn't working because I have to manually update the tessellation factor inside the hull shader. I believe the camera position isn't updating either because when I perform distance adaptation the far edges are more tessellated then the what's truly in front of the camera. I have all the buffers set to dynamic. Inside the render loop I have them set as:
ID3D11Buffer *multiBuffers[3];
devcon->VSSetConstantBuffers(0,3,multiBuffers);
...
devcon->DSSetConstantBuffers(0,3,multiBuffers);
I only got that from a directX Sample. Inside the shader file I have the three cbuffer structs.
cbuffer ConstantBuffer
{
float4x4 WorldMatrix;
float4x4 viewMatrix;
float4x4 projectionMatrix;
float4x4 modelWorldMatrix; // the rotation matrix
float3 lightvec; // the light's vector
float4 lightcol; // the light's color
float4 ambientcol; // the ambient light's color
bool isSelected;
}
cbuffer cameraBuffer
{
float3 cameraDirection;
float padding;
}
cbuffer TessellationBuffer
{
float tessellationAmount;
float3 padding2;
}
Am I missing something or would anyone know why wouldn't my buffers update to the shader file?
© Game Development or respective owner