Tag Info

New answers tagged

0

There are a variety of formulae for converting colour to black and white. Furthermore, the programmer might mean something else when converting a vector into a scalar (length would be a common example). The shader compiler keeps things as simple as possible, just taking the first value in the vector, in your example. Experiment with different ways to get a ...


0

Please also expand on this: "world matrix of the UI" and show how it's constructed. If you do not explicitly supply a World, View, or Projection, Identity is used. This has the effect of multiplying everything by 1 (no change). Using a world matrix without a view matrix is the same as using a view matrix without a world matrix; (X*1)==(1*X)==(X). I ...


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


0

All the meshes are loading in from .x files by the CModel class Loading them means parsing all of the binary data into Vertex/Index buffers. While filling those Vertex buffers, it is creating a specific type of vertex; i.e. VertexPositionNormalTexture. When you draw any mesh, you are feeding the IA VertexPositionNormalTexture's. Please confirm that ...


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 ...



Top 50 recent answers are included