Hot answers tagged


I can't see anything fundamentally wrong with the shader, but here are a few things I find commonly done wrong with deferred shading that you might be doing. 1: Drawing full screen lights. The beauty of deferred shading is that you can pack your lights into geometry so that you only need to consider a part of the screen when drawing them (Like a cube with 2 ...


You are sampling from the same location on the texture for every output, therefore the output is a single colour. See the documentation for SampleLevel A fix would look something like this: float2 uv = float2(dispatchThreadID.xy) / float2(textureWidthHeight); float4 test = gDiffuseMap.SampleLevel( samAnisotropic, uv, 0 );


The primary thing that stands out is that your loop copy initializes the auto val loop variable with the elements as you iterate. Even though your type is reasonably small, there's a bunch of overhead in doing so and it's likely that you would gain some by going for auto& val. Of secondary concern is that you're using strings for non-textual things. ...


Picking is not generally performed by the GPU so the use of instancing shouldn't matter. Your CPU-side code presumably knew where the cubes where in order to put their transforms into the instance buffer. Hence it can do a ray-AABB test by transforming the picking ray into the space of the cube in the cube's local space. Happily, the local space for the ...

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