Tag Info

Hot answers tagged

3

From the question, this appears to be more a design problem rather than an API problem: specular power is not a property of the light, it's a property of the surface. By including it in your light properties cbuffer you're creating an artificial coupling between these two different classes of property, and it's likely to cause you further problems in the ...


3

In DirectX 10.x/11.0, constant buffers are intended to be updated as a unit (i.e. you have to update the whole thing). This is why our performance recommendations is to arrange your data in constant buffers by frequency of update rather than having large cbuffers that contain variables that are updated frequently (per-object) and others that are updated ...


1

The Z coordinate has a different meaning when we're talking about viewport coordinates. In most vertex shaders, at some point you are multiplying each vertex by a projection matrix in order to convert world coordinates into viewport coordinates. After leaving the vertex shader, each vertex will be then divided by the W value. The resulting value is now in ...


1

Where could I find good HLSL tutorials? Reimer's Two ways off the top of my head: Light volume After rendering, switch to a flashlight shader and draw a cone (some triangles), with the tip located at the camera's position and the circular base pointing in the camera's forward direction, with arbitrary dimensions. You literally render a cone containing ...


1

Verdict: One of the cBuffers was set to the incorrect stage. Edit: I'll leave this here because it was irrelevant, but not entirely worthless in the future. If your structs are cbuffers, they should be of type cbuffer. cbuffer cbBaseLight : register(b0) //16*2=32-bytes { float4 color; float4 intensity; }; cbuffer cbDirectionalLight : register(b1) ...


1

It will probably be exactly the same output code, the HLSL compilers are now intelligent enough to optimize those operations. Plus if you think about the micro code, it will probably look like : mad regx, regm, rega, regx with regx regm and rega being the respective registers of m a and x



Only top voted, non community-wiki answers of a minimum length are eligible