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!


-Tau-

Member Since 13 Jul 2011
Offline Last Active Feb 10 2015 01:30 PM

Posts I've Made

In Topic: Texture render target size

10 February 2015 - 01:28 PM

Well, you must still set the correct viewport. I don't see you doing that.

 

THIS, thank you good sir.


In Topic: Texture render target size

10 February 2015 - 12:10 PM

Scene rendered with shadows:

Here size of shadow map texture is same as size of window:

http://postimg.org/image/oiliy12xp/

Here size of shadow map is 1024x1024, different than size of window:

http://postimg.org/image/cz226jcgh/

 

Maybe i asked a wrong question in the first place.

This is how i switch render targets:

	ID3D11RenderTargetView *prentw = 0;
	ID3D11DepthStencilView *dsw = 0;
	float ClearColor[4] = { 0.0f, 0.0f, 0.0f, 1.0f };

	pd3dImmediateContext->OMGetRenderTargets(1, &prentw, &dsw);
	pd3dImmediateContext->OMSetRenderTargets(1, &m_ShadowCtrl->m_pShadowRTV[0], m_ShadowCtrl->m_pDSV);
	pd3dImmediateContext->ClearDepthStencilView(m_ShadowCtrl->m_pDSV, D3D11_CLEAR_DEPTH, 1.0, 0);
	pd3dImmediateContext->ClearRenderTargetView(m_ShadowCtrl->m_pShadowRTV[0], ClearColor);

//
// rendering
//

	pd3dImmediateContext->OMSetRenderTargets(1, &prentw, dsw);
	SAFE_RELEASE(dsw);
	SAFE_RELEASE(prentw);

After pd3dImmediateContext->OMSetRenderTargets(1, &m_ShadowCtrl->m_pShadowRTV[0], m_ShadowCtrl->m_pDSV); the size of render target changes from size of window to size of texture.

Does ID3D11DeviceContext know that the size changed? If no, how do i tell him?


In Topic: Texture render target size

10 February 2015 - 08:49 AM

What i want to do: i want to apply blured shadows to my scene. I know how shadow maps work.

First i render the scene depths from point of light with (yes) orthogonal projection matrix to a texture. First image

Then i apply blur efect to this texture. Second image.

Then i use this texture to determine whitch parts of the rendered scene are in shadows.

 


In the third and fourth pictures you provide links to, it's not clear exactly what the red-and-black image is. The third image appears to be the original unblurred depth map rendered somehow with a different view, perhaps a perspective (vs. orthogonal) projection? The fourth image appears to be the blurred depth map rendered with yet a different view?

 

Now this is where things get complicated. The third image is renderd in the same way as the first. Same projection matrix. The fourth image is the same as the second image. Same blur effect same projection matrix. The only difference between first/third, second/fourth image is the size of texture to whitch i render. First and second textures have same size as screen and third and fourth have size 1024 x 1024.


In Topic: Texture render target size

10 February 2015 - 06:12 AM

Problem isn't creating custom sized texture, problem is using custom size texture as render target.

I show it, these are textures with screen size:

depth:

http://postimg.org/image/6op6bvezj/

blur:

http://postimg.org/image/6431k9ibt/

These are textures with size 1024 x 1024:

depth:

http://postimg.org/image/k3c8wuaoh/

blur:

http://postimg.org/image/bufazvrex/

Rendered scene wont fit into that texture.


In Topic: Unsigned int in vertex shader

14 September 2014 - 12:14 PM

Thanks for the tip, i changed D3DDECLTYPE_UBYTE4 to D3DDECLTYPE_D3DCOLOR and unsigned int vTexHeight to float4 vTexHeight. Now i get bytes with

int u1=(int)(vTexHeight.b*255);
int u2=(int)(vTexHeight.g*255);
int u3=(int)(vTexHeight.r*255);
int u4=(int)(vTexHeight.a*255);


PARTNERS