void RenderingContext::ApplyBatch( IRenderBatch* val ) { SetBatch(val); if (mBatch!=nullptr) { mBatch->Apply(); UpdateShaderVariables(); } }
void RenderingContext::ApplyMaterial(const IMaterial* val ) { SetMaterial(val); if (mMaterial!=nullptr) { mMaterial->Apply(); UpdateShaderVariables(); } }
void RenderingContext::ApplyRenderPass( IRenderPass* val ) { SetRenderPass(val); if (mRenderPass!=nullptr) { mRenderPass->Invalidate(); mRenderPass->Apply(); UpdateShaderVariables(); } }
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); } }
void RenderingContext::ApplyDrawMode(GraphicsDrawMode val) { SetDrawMode(val); UpdateShaderVariables(); }
void RenderingContext::ApplyState(RenderStateTreeLeafNode* stateNode) { SetState(stateNode); stateNode->Apply(); UpdateShaderVariables(); }
/* Fragment Shader Functions! */ FragmentShader::FragmentShader(std::string name) : Shader(name, FRAGMENT_SHADER) { UpdateShaderVariables(); }