Beispiel #1
0
void RenderingContext::ApplyBatch( IRenderBatch* val )
{
	SetBatch(val);
	if (mBatch!=nullptr)
	{
		mBatch->Apply();
		UpdateShaderVariables();
	}
}
Beispiel #2
0
void RenderingContext::ApplyMaterial(const  IMaterial* val )
{
	SetMaterial(val);

	if (mMaterial!=nullptr)
	{
		mMaterial->Apply();
		UpdateShaderVariables();
	}
}
Beispiel #3
0
void RenderingContext::ApplyRenderPass( IRenderPass* val )
{
	SetRenderPass(val);
	
	if (mRenderPass!=nullptr)
	{
		mRenderPass->Invalidate();
		mRenderPass->Apply();
		UpdateShaderVariables();
	}
}
Beispiel #4
0
void CShader::Render(ID3D11DeviceContext *pd3dDeviceContext, CCamera *pCamera)
{
	pd3dDeviceContext->IASetInputLayout(m_pd3dVertexLayout);
	pd3dDeviceContext->VSSetShader(m_pd3dVertexShader, NULL, 0);
	pd3dDeviceContext->PSSetShader(m_pd3dPixelShader, NULL, 0);

	for (int j = 0; j < m_nObjects; j++)
	{
		if (m_ppObjects[j])
		{
			//객체의 물질 정보를 쉐이더 프로그램으로 전달한다.
			if (m_ppObjects[j]->m_pMaterial) UpdateShaderVariables(pd3dDeviceContext, &m_ppObjects[j]->m_pMaterial->m_Material);
			UpdateShaderVariables(pd3dDeviceContext, &m_ppObjects[j]->m_d3dxmtxWorld);
			m_ppObjects[j]->Render(pd3dDeviceContext);
		}
	}
	if (m_pTerrain)
	{
		UpdateShaderVariables(pd3dDeviceContext, &m_pTerrain->m_d3dxmtxWorld);
		m_pTerrain->Render(pd3dDeviceContext, pCamera);
	}
}
Beispiel #5
0
void RenderingContext::ApplyDrawMode(GraphicsDrawMode val)
{
	SetDrawMode(val);
	UpdateShaderVariables();

}
Beispiel #6
0
void RenderingContext::ApplyState(RenderStateTreeLeafNode* stateNode)
{
	SetState(stateNode);
	stateNode->Apply();
	UpdateShaderVariables();
}
Beispiel #7
0
/*


Fragment Shader Functions!


*/
FragmentShader::FragmentShader(std::string name) : Shader(name, FRAGMENT_SHADER)	{
	UpdateShaderVariables();
}