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


2

This particular code is loading images (maybe DDS files or maybe general bitmap files) into a CPU staging resource doing a format conversion and resize. Presumably you are going to do something else with the srcTexture array that actually creates the resource you are going to render with. This is a lot of runtime processing, so the best option is to do that ...


1

Please consider this first-party library; it is from MS, so if it is not-third-party enough for you, it will make your life considerably easier. It provides an interface to DX11 that is very similar to XNA. Specifically, SpriteBatch, SpriteFont, etc.. Rastertek and Reimer's are generally helpful. For Rastertek, I linked directly to their DX11 2D tutorial, ...


1

Most games use an entirely separate system to do this, such as Scaleform, though there are some exceptions.


1

First, set the primitive topology to TRIANGLESTRIP (ID3D11DeviceContext::IASetPrimitiveTopology), set the following shaders then call devicecontext->Draw(4,0). You don't even need vertex buffers for this because of the automatic system value of vertex id in the shader. float4 VertexShader(uint vI : SV_VERTEXID):SV_POSITION { float2 texcoord = ...


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