本文整理汇总了C++中sphere::Render方法的典型用法代码示例。如果您正苦于以下问题:C++ sphere::Render方法的具体用法?C++ sphere::Render怎么用?C++ sphere::Render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sphere
的用法示例。
在下文中一共展示了sphere::Render方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: V
//--------------------------------------------------------------------------------------
// Render the scene using the D3D11 device
//--------------------------------------------------------------------------------------
void CALLBACK OnD3D11FrameRender( ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, double fTime,
float fElapsedTime, void* pUserContext )
{
HRESULT hr;
// If the settings dialog is being shown, then render it instead of rendering the app's scene
if( g_D3DSettingsDlg.IsActive() )
{
g_D3DSettingsDlg.OnRender( fElapsedTime );
return;
}
//Render light arrow
D3DXMATRIX mView;
D3DXMATRIX mProj;
mProj = ( *g_Camera.GetProjMatrix() );
mView = ( *g_Camera.GetViewMatrix() );
D3DXCOLOR arrowColor = D3DXCOLOR( 1, 1, 0, 1 );
//hr = g_LightControl.OnRender11( arrowColor, &mView, &mProj, g_Camera.GetEyePt() );
FirePart.calculate_particle(pd3dDevice,pd3dImmediateContext,fElapsedTime,&g_Camera,&g_LightControl);
MissilePart.calculate_particle(pd3dDevice,pd3dImmediateContext,fElapsedTime,&g_Camera,&g_LightControl);
board1.RenderTexture(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_LightControl);
deboard.RenderTexture(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_LightControl);
// Clear the render target and depth stencil
float ClearColor[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
//ID3D11RenderTargetView* pRTV = DXUTGetD3D11RenderTargetView();
ID3D11RenderTargetView* pRTV = DXUTGetD3D11RenderTargetView();
pd3dImmediateContext->ClearRenderTargetView( rtv_render_to_texture_ori, ClearColor );
ID3D11DepthStencilView* pDSV = DXUTGetD3D11DepthStencilView();
pd3dImmediateContext->ClearDepthStencilView( pDSV, D3D11_CLEAR_DEPTH, 1.0, 0 );
pd3dImmediateContext->OMSetRenderTargets(1,&rtv_render_to_texture_ori,pDSV);
pd3dImmediateContext->OMSetDepthStencilState(NULL, 0);
sky.Render(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_Camera,lightpos);
lightsphere.Render(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_Camera,lightpos);
tessplane.Render(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_Camera,lightpos);
tesscube.Render(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_Camera,lightpos);
fuse.Render(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_Camera,&g_LightControl);
board1.Render(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_Camera,lightpos);
deboard.Render(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_Camera,lightpos);
test.Render(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_Camera,lightpos);
if(show_buildings)
{
buildings.Render(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_Camera,lightpos);
}
geo_alien.Render(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_Camera,lightpos);
FirePart.Render(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_Camera);
MissilePart.Render(pd3dDevice,pd3dImmediateContext,fTime,fElapsedTime,pUserContext,&g_Camera);
//ID3D11RenderTargetView* pRTV = DXUTGetD3D11RenderTargetView();
pd3dImmediateContext->OMSetDepthStencilState(NULL, 0);
pd3dImmediateContext->OMSetBlendState(NULL,NULL,0xffffffff);
//find bright spot
pd3dImmediateContext->ClearRenderTargetView( rtv_render_to_texture_1, ClearColor );
pDSV = DXUTGetD3D11DepthStencilView();
pd3dImmediateContext->ClearDepthStencilView( pDSV, D3D11_CLEAR_DEPTH, 1.0, 0 );
pd3dImmediateContext->OMSetRenderTargets(1,&rtv_render_to_texture_1,pDSV);
pd3dImmediateContext->VSSetShader( VSPPFirstPass, NULL, 0 );
pd3dImmediateContext->PSSetShader( PSPPFirstPass, NULL, 0 );
pd3dImmediateContext->HSSetShader( NULL, NULL, 0 );
pd3dImmediateContext->DSSetShader( NULL, NULL, 0 );
pd3dImmediateContext->GSSetShader( NULL, NULL, 0 );
pd3dImmediateContext->PSSetSamplers(0, 1, &g_pSamLinear);
pd3dImmediateContext->PSSetShaderResources(0,1,&sr_texture_original);
//pd3dImmediateContext->RSSetState( g_pRasterizerStateSolid );
pd3dImmediateContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
pd3dImmediateContext->Draw(9,0);
//blur hori
pd3dImmediateContext->ClearRenderTargetView( rtv_render_to_texture_2, ClearColor );
pDSV = DXUTGetD3D11DepthStencilView();
pd3dImmediateContext->ClearDepthStencilView( pDSV, D3D11_CLEAR_DEPTH, 1.0, 0 );
pd3dImmediateContext->OMSetRenderTargets(1,&rtv_render_to_texture_2,pDSV);
Compute_blur(1.0f / width, 0);
D3D11_MAPPED_SUBRESOURCE MappedResource;
V( pd3dImmediateContext->Map( blur_cb_buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource ) );
blur_cbuffer* pPerFrame = ( blur_cbuffer* )MappedResource.pData;
std::copy(&blur_cb_data.offset[0], &blur_cb_data.offset[15], pPerFrame->offset);
//std::copy(&blur_cb_data.offset[0], &blur_cb_data.offset[15], pPerFrame->offset);
//std::copy(&blur_cb_data.weight[0], &blur_cb_data.weight[15], pPerFrame->weight);
pd3dImmediateContext->Unmap( blur_cb_buffer, 0 );
pd3dImmediateContext->VSSetShader( VSPPBlur, NULL, 0 );
//.........这里部分代码省略.........