Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 05 Mar 2012
Offline Last Active Jul 16 2013 03:51 AM

#4966382 Deferred rendering tutorials for DirectX 11?

Posted by on 05 August 2012 - 09:52 AM

There's at least one book with an example implementation. Practical Rendering and Computation with DirectX 11.

#4959534 Remeber state of pixel in HLSL.

Posted by on 16 July 2012 - 04:47 AM

Hmm if you said DX11 I would say use an unordered access view (UAV) and use it as a RWTexture2D in your pixel shader. It looks like those are only available in the compute shader for DX10.

#4958184 Screen space , World space issue ?

Posted by on 11 July 2012 - 04:12 PM

This shader is going from screen space to world space.

It is taking a point (where w == 1 i.e. screen space) and multiplying by the inverse of the view*projection matrix. After this multiplication w should not be 1. You then divide the point by w to get the world space coordinates.

I'll have to do more digging in my graphics text book for a detailed explanation. What I've just given you is based off memory and a quick refresher.

#4957966 Screen space , World space issue ?

Posted by on 11 July 2012 - 04:23 AM

Look up the terms perspective divide and homogeneous coordinates.

Also, post code for the shaders please. It is hard to imagine the full context.

Thank you.

#4954312 CreateVertexShader fails

Posted by on 30 June 2012 - 07:49 AM

It doesn't look like you are compiling it anywhere.

Check out D3DCompileFromFile.

I'm using visual studio 11. So i compile it from there : )
Also the buffer size isn't 0.

Am I missing something or maybe you don't know that shaders have to be compiled to byte code? What function are you calling to compile the shader into bytecode?

#4942014 Model got no depth?

Posted by on 21 May 2012 - 03:27 PM

If you post your device & swap chain creation code it would help.

Specifically, post your depth/stencil and backbuffer configuration structures and the call to create them.

It also appears to me you have some wind-ordering issue with your model. Have you tried setting the rasterizer state to not cull back/front faces?

#4937063 how to solve "Resource being set to OM UnorderedAccessView slot 1 is stil...

Posted by on 03 May 2012 - 05:47 AM

It must look like this. It's verbose, but there you have it.

ID3D11ShaderResourceView* pNullSRV = NULL;
m_pContext->CSSetShaderResources(0, 1, &pNullSRV);

ID3D11UnorderedAccessView* pNullUAV = NULL;
m_pContext->CSSetUnorderedAccessViews(0, 1, &pNullUAV, NULL);

#4926530 Setting mipmap level ?

Posted by on 29 March 2012 - 08:25 PM

Assuming you have created a texture2d object with mip maps in Directx11, you can create a shader resource view which contains one or all mip levels.

If you create it with all mip levels, you can choose the mip level you want to sample in your shader. Not to confuse you further, but the method is actually Load, not sample. Sample uses a sampler, which I don't think can select mip levels directly ( you have to create a shader resource view with a single mip if you want to sample ... I think). If you have a multiple mip-map level resource you can use load to get the value at (x,y,z) where z is the mip level.