Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Medo3337

Member Since 24 Apr 2012
Offline Last Active Feb 02 2015 10:16 PM

Posts I've Made

In Topic: Render To Texture

02 February 2015 - 07:04 PM

@L. Spiro:

 

 

So, I tried setting SampleDesc to be the same as the depth stencil SampleDesc and CreateRenderTargetView is now returning HRESULT E_INVALIDARG

 

If I set the multisample count to 4 in both, I get HRESULT E_INVALIDARG, however If I set multisample count to 1 in both, the program works correctly.


In Topic: Render To Texture

02 February 2015 - 06:41 PM

@Hodgman: Well, there should be nothing rendered to the back buffer, so even when I call Present() it should draw nothing to the back buffer since I'm rendering to the texture.

 

More over, I found the following error message:

 

D3D11 ERROR: ID3D11DeviceContext::OMSetRenderTargets: The RenderTargetView at slot 0 is not compatable with the DepthStencilView. DepthStencilViews may only be used with RenderTargetViews if the effective dimensions of the Views are equal, as well as the Resource types, multisample count, and multisample quality. The RenderTargetView at slot 0 has (w:800,h:600,as:1), while the Resource is a Texture2D with (mc:1,mq:0). The DepthStencilView has (w:800,h:600,as:1), while the Resource is a Texture2D with (mc:4,mq:0). D3D11_RESOURCE_MISC_TEXTURECUBE factors into the Resource type, unless GetFeatureLevel() returns D3D_FEATURE_LEVEL_10_1 or greater. [ STATE_SETTING ERROR #388: OMSETRENDERTARGETS_INVALIDVIEW]

 

So, I tried setting SampleDesc to be the same as the depth stencil SampleDesc and CreateRenderTargetView is now returning HRESULT E_INVALIDARG

 

SampleDesc is set as the following:

SampleDesc.Count = 4;
SampleDesc.Quality = 0;

If I set SampleDesc.Count to 1, the program work as expected, it seems that render to texture is only working without multisampling

 

How do I enable multisampling while rendering to texture?


In Topic: Sending World, View and Projection Matrices To D3D9 Vertex Shader

01 February 2015 - 09:07 AM

@Buckeye: Well, I have been writing VS and PS for long time, so you shouldn't really judge other people.

 

Perhaps there is misunderstanding.

 

FYI, Using macros resolved the problem, I used constant buffers in D3D11 and ID3DXConstantTable in D3D9 to pass world, view and projection matrices.


In Topic: Sending World, View and Projection Matrices To D3D9 Vertex Shader

01 February 2015 - 03:43 AM

@Buckeye: Do you mean I should use constant buffers for D3D11 and registers for D3D9?

 

If yes, does that means I should use vertex shader macros to check if it's D3D9 or D3D11 and define the matrices accordingly?

 

Example

VS:

#ifdef D3D11
cbuffer MatrixBuffer
{
     matrix worldMatrix;
     matrix viewMatrix;
     matrix projectionMatrix;
};
#else
     float4x4 worldMatrix;
     float4x4 viewMatrix;
     float4x4 projectionMatrix;
#endif

 

Thanks for your help.


In Topic: Sending World, View and Projection Matrices To D3D9 Vertex Shader

31 January 2015 - 01:06 PM

@Buckeye: I want to have a single method, for example: IRenderer::SetTransform(D3DXMATRIX matWorld, D3DXMATRIX matView, D3DXMATRIX matProj)

 

The above method should be able to set the shader constants "world, view, projection" on either D3D9 or D3D11 (based on the D3D version I choose)

 

I mean I can't use cbuffer in my shader since it's not support by D3D9, so if I will use constant table in D3D9, what should I use in D3D11 to do the same thing with the same shader?


PARTNERS