Jump to content

  • Log In with Google      Sign In   
  • Create Account

-Tau-

Member Since 13 Jul 2011
Offline Last Active May 31 2016 10:38 AM

Posts I've Made

In Topic: Quaternion as angular velocity

30 May 2016 - 11:01 AM

Thanks for the replies, at first i thought i shouldn't use slerp as i couldn't simply transfer from one orientation to another, and really need angular velocity. Then i realized i can use slerp to create angular velocity if i simply lerp between identity quaternion and Q1->Q2 quaternion.

What i did:

 

get quaternion that points from matrix 1 to matrix 2: Q1 -> Q2

to get this i did q = Q1^(-1) * Q2

 

now q is orientation that is requires to rotate Matrix 1 to Matrix 2

to get a small part of this orientation every frame update

quatnow = XMQuaternionSlerp(XMQuaternionIdentity(), m_vAdjustQuat, fElapsedTime / CLIENT_POSITION_ADJUST_TIME);

m_mWorldMat = XMMatrixRotationQuaternion(quatnow)*m_mWorldMat;

 

This looks kinda promising but there are still some visible lags.


In Topic: Game login - password sending security

15 July 2015 - 12:04 PM

Sorry i forgot to mention, i'm using C++ with RakNet library.


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.


PARTNERS