Jump to content

  • Log In with Google      Sign In   
  • Create Account


RTT in Multitexture


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 zonozz   Members   -  Reputation: 158

Like
0Likes
Like

Posted 24 March 2013 - 04:38 AM

Hi everyone !

 

Question : Motional scene rendered to texture blending with static texture causes cpu utilization up to 80%.

 

Desc:

I try to use texture-blending in render to texture's texture( I'm doing Raster Tek's tutorials ), I make a texture array class for manage multitextures, one of it's function is to add texture from disk & from ID3D11ShaderResourceView. And the shader render function receive texture array by ID3D11ShaderResourceView**, when rendering, it shows a serious performance problems, I think it because add texture(which is the motional scene rendered to) to texture array should copy data to one node, this operation maybe spend much time. So each frame texture array should do copy operation.

 

I change my code to 2 ID3D11ShaderResourcesView variables as this shader's render function params, but I really want anather way to solve.

 

(These 2 variables running without multitexture manager, but in fact it is a multitexture object). Please help me. Thanks a lot.



Sponsor:

#2 Jason Z   Crossbones+   -  Reputation: 4911

Like
2Likes
Like

Posted 24 March 2013 - 05:59 AM

Are you copying the texture to a GPU resource every frame?  If so, that is not a good way to do it - you should only copy it once.  If you are rendering to a texture, then the render target's Texture2D already contains the contents of the scene and you just need to use it with a shader resource view in the subsequent pass.

 

I'm not familiar with the tutorial that you are describing - can you provide more information on what exactly you are trying to do from an API level?



#3 zonozz   Members   -  Reputation: 158

Like
0Likes
Like

Posted 24 March 2013 - 07:38 AM

Are you copying the texture to a GPU resource every frame?  If so, that is not a good way to do it - you should only copy it once.  If you are rendering to a texture, then the render target's Texture2D already contains the contents of the scene and you just need to use it with a shader resource view in the subsequent pass.

 

I'm not familiar with the tutorial that you are describing - can you provide more information on what exactly you are trying to do from an API level?

 

Thank you ! I'm sorry for my description not clear ( I'm learning english : p )

 

I know how to do that, I mean I want to manage all multitexture objs by multitexture manager, but each frame I add now rendered scene to texture array and do shader with another texture then I realease the texture ( next frame I add rendered texture again ), so it must be a terrible method, now I try to get the texture need to change in texture array, I just need one more interface to access this texture , and update it.

 

this is my code :

 

this->m_pRTT_Perlin_Array[1] = tmpRenderToTexture->GetShaderResourceView();

	this->m_pGraphics->TurnOffZBuffer();

	this->m_pGraphics->GetD3DObj()->GetWorldMatrix(worldShaderDebugger);

	this->m_pGraphics->RenderShaderDebuggerWindow(50, 500);

	this->m_pMultiTextureShader->Render(this->m_pGraphics->GetD3DObj()->GetDeviceContextPointer(),
		tmpShaderDebugger->GetIndexCount(), 2, this->worldShaderDebugger, this->baseView, this->ortho,
		this->m_pRTT_Perlin_Array);

	this->m_pGraphics->TurnOnZBuffer();

 

 

and previous code like this :

this->m_pGraphics->TurnOffZBuffer();

	this->m_pTextureSequence->AddShaderResroucesToSequence(MULTITEX_RTT_PERLIN, tmpRenderToTexture->GetShaderResourceView(), NULL);

	this->m_pGraphics->GetD3DObj()->GetWorldMatrix(worldShaderDebugger);

	this->m_pGraphics->RenderShaderDebuggerWindow(50, 500);

	this->m_pMultiTextureShader->Render(this->m_pGraphics->GetD3DObj()->GetDeviceContextPointer(),
		tmpShaderDebugger->GetIndexCount(), 2, this->worldShaderDebugger, this->baseView, this->ortho,
		this->m_pRTT_Perlin_Array);

	this->m_pTextureSequence->RemoveTextureSequence(MULTITEX_RTT_PERLIN);

	this->m_pGraphics->TurnOnZBuffer();





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS