• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pRenderContext函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中pRenderContext函数的典型用法代码示例。如果您正苦于以下问题:C++ pRenderContext函数的具体用法?C++ pRenderContext怎么用?C++ pRenderContext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pRenderContext函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: pRenderContext

bool C_CFPlayer::OnPostInternalDrawModel( ClientModelRenderInfo_t *pInfo )
{
	CMatRenderContextPtr pRenderContext( materials );
	pRenderContext->DepthRange(0.0f, 1.0f);

	return BaseClass::OnPostInternalDrawModel(pInfo);
}
开发者ID:BSVino,项目名称:Arcon,代码行数:7,代码来源:c_cf_player.cpp


示例2: OverlayCameraRenderTarget

void OverlayCameraRenderTarget(const char *pszMaterialName, float flX, float flY, float w, float h)
{
    float offsetS = (0.5f / 256.0f);
    float offsetT = (0.5f / 256.0f);
    IMaterial *pMaterial;
    pMaterial = materials->FindMaterial(pszMaterialName, TEXTURE_GROUP_OTHER, true);
    if (!IsErrorMaterial(pMaterial))
    {
        CMatRenderContextPtr pRenderContext(materials);
        pRenderContext->Bind(pMaterial);
        IMesh* pMesh = pRenderContext->GetDynamicMesh(true);

        CMeshBuilder meshBuilder;
        meshBuilder.Begin(pMesh, MATERIAL_QUADS, 1);

        meshBuilder.Position3f(flX, flY, 0.0f);
        meshBuilder.TexCoord2f(0, 0.0f + offsetS, 0.0f + offsetT);
        meshBuilder.AdvanceVertex();

        meshBuilder.Position3f(flX + w, flY, 0.0f);
        meshBuilder.TexCoord2f(0, 1.0f + offsetS, 0.0f + offsetT);
        meshBuilder.AdvanceVertex();

        meshBuilder.Position3f(flX + w, flY + h, 0.0f);
        meshBuilder.TexCoord2f(0, 1.0f + offsetS, 1.0f + offsetT);
        meshBuilder.AdvanceVertex();

        meshBuilder.Position3f(flX, flY + h, 0.0f);
        meshBuilder.TexCoord2f(0, 0.0f + offsetS, 1.0f + offsetT);
        meshBuilder.AdvanceVertex();

        meshBuilder.End();
        pMesh->Draw();
    }
}
开发者ID:Yosam02,项目名称:game,代码行数:35,代码来源:viewdebug.cpp


示例3: VPROF

void CGlowOverlay::DrawOverlays( bool bCacheFullSceneState )
{
	VPROF("CGlowOverlay::DrawOverlays()");

	CMatRenderContextPtr pRenderContext( materials );

	bool bClippingEnabled = pRenderContext->EnableClipping( true );

	unsigned short iNext;
	for( unsigned short i=g_GlowOverlaySystem.m_GlowOverlays.Head(); i != g_GlowOverlaySystem.m_GlowOverlays.InvalidIndex(); i = iNext )
	{
		iNext = g_GlowOverlaySystem.m_GlowOverlays.Next( i );
		CGlowOverlay *pOverlay = g_GlowOverlaySystem.m_GlowOverlays[i];
		
		if( !pOverlay->m_bActivated )
			continue;

		if( pOverlay->Update() )
		{
			pRenderContext->EnableClipping( ((pOverlay->m_bInSky) ? (false):(bClippingEnabled)) ); //disable clipping in skybox, restore clipping to pre-existing state when not in skybox (it may be off as well)
			pOverlay->Draw( bCacheFullSceneState );
		}
		else
		{
			delete pOverlay;
		}
	}

	pRenderContext->EnableClipping( bClippingEnabled ); //restore clipping to original state
}
开发者ID:Yosam02,项目名称:game,代码行数:30,代码来源:glow_overlay.cpp


示例4: GetAbsOrigin

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void C_PropCombineBall::DrawMotionBlur( void )
{
	float color[3];

	Vector	vecDir = GetAbsOrigin() - m_vecLastOrigin;
	float	speed = VectorNormalize( vecDir );
	
	speed = clamp( speed, 0, 32 );
	
	float	stepSize = MIN( ( speed * 0.5f ), 4.0f );

	Vector	spawnPos = GetAbsOrigin();
	Vector	spawnStep = -vecDir * stepSize;

	float base = RemapValClamped( speed, 4, 32, 0.0f, 1.0f );

	CMatRenderContextPtr pRenderContext( materials );
	pRenderContext->Bind( m_pBlurMaterial );

	// Draw the motion blurred trail
	for ( int i = 0; i < 8; i++ )
	{
		spawnPos += spawnStep;

		color[0] = color[1] = color[2] = base * ( 1.0f - ( (float) i / 12.0f ) );

		DrawHalo( m_pBlurMaterial, spawnPos, m_flRadius, color );
	}
}
开发者ID:1n73rf4c3,项目名称:source-sdk-2013,代码行数:32,代码来源:c_prop_combine_ball.cpp


示例5: pRenderContext

int C_Hairball::DrawModel( int flags )
{
	if ( !m_pMaterial )
		return 0;

	CMatRenderContextPtr pRenderContext( g_pMaterialSystem );
	for ( int iHair=0; iHair < m_nHairs; iHair++ )
	{
		CSimplePhysics::CNode *pBase = &m_Nodes[iHair * m_nNodesPerHair];
		
		CBeamSegDraw beamDraw;
		beamDraw.Start( pRenderContext, m_nNodesPerHair-1, m_pMaterial );

		for ( int i=0; i < m_nNodesPerHair; i++ )
		{
			BeamSeg_t seg;
			seg.m_vPos = pBase[i].m_vPredicted;
			seg.m_vColor.Init( 0, 0, 0 );
			seg.m_flTexCoord = 0;
			static float flHairWidth = 1;
			seg.m_flWidth = flHairWidth;
			seg.m_flAlpha = 0;

			beamDraw.NextSeg( &seg );
		}
		
		beamDraw.End();
	}

	return 1;
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:31,代码来源:c_hairball.cpp


示例6: QAngle

//-----------------------------------------------------------------------------
// Purpose: Sets view parameters for level overview mode
// Input  : *rect - 
//-----------------------------------------------------------------------------
void CViewRender::SetUpOverView()
{
	static int oldCRC = 0;

	m_View.m_bOrtho = true;

	float aspect = (float)m_View.width/(float)m_View.height;

	int size_y = 1024.0f * cl_leveloverview.GetFloat(); // scale factor, 1024 = OVERVIEW_MAP_SIZE
	int	size_x = size_y * aspect;	// standard screen aspect 

	m_View.origin.x -= size_x / 2;
	m_View.origin.y += size_y / 2;

	m_View.m_OrthoLeft   = 0;
	m_View.m_OrthoTop    = -size_y;
	m_View.m_OrthoRight  = size_x;
	m_View.m_OrthoBottom = 0;

	m_View.angles = QAngle( 90, 90, 0 );

	// simple movement detector, show position if moved
	int newCRC = m_View.origin.x + m_View.origin.y + m_View.origin.z;
	if ( newCRC != oldCRC )
	{
		Msg( "Overview: scale %.2f, pos_x %.0f, pos_y %.0f\n", cl_leveloverview.GetFloat(),
			m_View.origin.x, m_View.origin.y );
		oldCRC = newCRC;
	}

	CMatRenderContextPtr pRenderContext( materials );
	pRenderContext->ClearColor4ub( 0, 255, 0, 255 );

	// render->DrawTopView( true );
}
开发者ID:newroob,项目名称:bg2-2007,代码行数:39,代码来源:view.cpp


示例7: VPROF_BUDGET

void CReplayRenderer::LayoffFrame( int nFrame )
{
	VPROF_BUDGET( "CReplayRenderer::LayoffFrame", VPROF_BUDGETGROUP_REPLAY );
	// FIXME: This is somewhat of a hack to get layoff working again
	// We're rendering into the full preview size, but stretching down to the actual size
	Rect_t srcRect;
	srcRect.x = 0;
	srcRect.y = 0;
	srcRect.width = m_RenderParams.m_Settings.m_nWidth;
	srcRect.height = m_RenderParams.m_Settings.m_nHeight;

	Rect_t dstRect;
	dstRect.x = 0;
	dstRect.y = 0;
	dstRect.width = m_RenderParams.m_Settings.m_nWidth;
	dstRect.height = m_RenderParams.m_Settings.m_nHeight;

	#ifdef TRACE_REPLAY_STATE_MACHINE
		Msg( "laying off movie frame %i\n", nFrame );
	#endif

	CMatRenderContextPtr pRenderContext( materials );
// 	pRenderContext->ReadPixelsAndStretch( &srcRect, &dstRect, (unsigned char*)m_pLayoffBuf, 
// 		IMAGE_FORMAT_BGRA8888, dstRect.width * ImageLoader::SizeInBytes( IMAGE_FORMAT_BGRA8888 ) );

	pRenderContext->ReadPixels( 0, 0, (int) m_RenderParams.m_Settings.m_nWidth, (int) m_RenderParams.m_Settings.m_nHeight, (unsigned char*)m_pLayoffBuf, IMAGE_FORMAT_BGRA8888 );

	static ConVarRef mat_queue_mode( "mat_queue_mode" );

	// Encode the frame
#ifdef REPLAY_RECORDING_ENABLE
	if ( m_RenderParams.m_bExportRaw )
	{
		CUtlBuffer bufOut;
        if ( TGAWriter::WriteToBuffer( (unsigned char *)m_pLayoffBuf, bufOut, m_RenderParams.m_Settings.m_nWidth,
			m_RenderParams.m_Settings.m_nHeight, IMAGE_FORMAT_BGRA8888, IMAGE_FORMAT_RGB888 ) )
		{
			// Format filename and write the TGA
			CFmtStr fmtFilename(
				"%sFrame_%04i.tga",
				m_fmtTgaRenderDirName.Access(),
				m_iTgaFrame++
			);

	        if ( !g_pFullFileSystem->WriteFile( fmtFilename.Access(), NULL, bufOut ) )
	        {
	            Warning( "Couldn't write bitmap data snapshot to file %s.\n", fmtFilename.Access() );
	        }
		}
	}
	else if ( m_pMovieMaker )
	{
		// can't run in any other mode	
		Assert( mat_queue_mode.GetInt() == 0 );
		VPROF_BUDGET( "CReplayRenderer::LayoffFrame - AppendVideoFrame", VPROF_BUDGETGROUP_REPLAY );
		m_pMovieMaker->AppendVideoFrame( m_pLayoffBuf );
	}
#endif
}
开发者ID:1n73rf4c3,项目名称:source-sdk-2013,代码行数:59,代码来源:replayrenderer.cpp


示例8: pRenderContext

//-----------------------------------------------------------------------------
// Sets a default env_cubemap for rendering materials w/ specularity
//-----------------------------------------------------------------------------
void CSceneViewerApp::InitDefaultEnvCubemap( )
{
	// Deal with the default cubemap
	CMatRenderContextPtr pRenderContext( g_pMaterialSystem );
	ITexture *pCubemapTexture = g_pMaterialSystem->FindTexture( "editor/cubemap", NULL, true );
	m_DefaultEnvCubemap.Init( pCubemapTexture );
	pRenderContext->BindLocalCubemap( pCubemapTexture );
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:11,代码来源:sceneviewer.cpp


示例9: pRenderContext

//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
void CDmeDrawSettings::DrawDag( CDmeDag *pDag )
{
	if ( !pDag )
		return;

	CMatRenderContextPtr pRenderContext( g_pMaterialSystem );

	m_IsAMaterialBound = false;

	if ( !Shaded() )
	{
		BindWireframe();
	}
	else if ( GetGrayShade() )
	{
		BindGray();
	}

	pDag->Draw( this );

	m_IsAMaterialBound = false;

	if ( GetWireframeOnShaded() )
	{
		if ( Shaded() )
		{
			VMatrix m;

			pRenderContext->GetMatrix( MATERIAL_PROJECTION, &m );

			/*	Extract the near and far clipping plane values from projection matrix
			float c = m[ 2 ][ 2 ];
			float d = m[ 2 ][ 3 ];

			const float near = d / ( c - 1.0f );
			const float far = d / ( c + 1.0f );
			*/

			const float zBias = 0.00025;
			m[ 2 ][ 2 ] += zBias;
			m[ 2 ][ 3 ] += zBias;

			pRenderContext->MatrixMode( MATERIAL_PROJECTION );
			pRenderContext->PushMatrix();
			pRenderContext->LoadMatrix( m );

			BindWireframeOnShaded();
			PushDrawType();
			SetDrawType( CDmeDrawSettings::DRAW_WIREFRAME );
			pDag->Draw( this );
			PopDrawType();

			pRenderContext->MatrixMode( MATERIAL_PROJECTION );
			pRenderContext->PopMatrix();
		}
	}
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:60,代码来源:dmedrawsettings.cpp


示例10: pRenderContext

void CColorCorrectionMgr::RemoveColorCorrection( ClientCCHandle_t h )
{
	if ( h != INVALID_CLIENT_CCHANDLE )
	{
		CMatRenderContextPtr pRenderContext( g_pMaterialSystem );
		ColorCorrectionHandle_t ccHandle = (ColorCorrectionHandle_t)h;
		pRenderContext->RemoveLookup( ccHandle );
	}
}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:9,代码来源:colorcorrectionmgr.cpp


示例11: DrawSmokeFogOverlay

void DrawSmokeFogOverlay()
{
	if(g_SmokeFogOverlayAlpha == 0 || !g_pSmokeFogMaterial || !materials)
		return;

	// Hard-coded for now..
	g_SmokeFogOverlayColor.Init( 0.3, 0.3, 0.3 );
	
	CMatRenderContextPtr pRenderContext( materials );

	pRenderContext->MatrixMode( MATERIAL_PROJECTION );
	pRenderContext->LoadIdentity();
	pRenderContext->Ortho( 0, 0, 1, 1, -99999, 99999 );

	pRenderContext->MatrixMode( MATERIAL_VIEW );
	pRenderContext->LoadIdentity();

	pRenderContext->MatrixMode( MATERIAL_MODEL );
	pRenderContext->LoadIdentity();

	IMesh* pMesh = pRenderContext->GetDynamicMesh( false, NULL, NULL, g_pSmokeFogMaterial );
	CMeshBuilder meshBuilder;

	static float dist = 10;

	Vector vColor = g_SmokeFogOverlayColor;
	vColor.x = MIN(MAX(vColor.x, 0), 1);
	vColor.y = MIN(MAX(vColor.y, 0), 1);
	vColor.z = MIN(MAX(vColor.z, 0), 1);
	float alpha = MIN(MAX(g_SmokeFogOverlayAlpha, 0), 1);

	meshBuilder.Begin( pMesh, MATERIAL_QUADS, 1 );

	meshBuilder.Position3f( 0, 0, dist );
	meshBuilder.Color4f( vColor.x, vColor.y, vColor.z, alpha );
	meshBuilder.TexCoord2f( 0, 0.0f, 0.0f );
	meshBuilder.AdvanceVertex();

	meshBuilder.Position3f( 0, 1, dist );
	meshBuilder.Color4f( vColor.x, vColor.y, vColor.z, alpha );
	meshBuilder.TexCoord2f( 0, 0.0f, 0.0f );
	meshBuilder.AdvanceVertex();

	meshBuilder.Position3f( 1, 1, dist );
	meshBuilder.Color4f( vColor.x, vColor.y, vColor.z, alpha );
	meshBuilder.TexCoord2f( 0, 0.0f, 0.0f );
	meshBuilder.AdvanceVertex();

	meshBuilder.Position3f( 1, 0, dist );
	meshBuilder.Color4f( vColor.x, vColor.y, vColor.z, alpha );
	meshBuilder.TexCoord2f( 0, 0.0f, 0.0f );
	meshBuilder.AdvanceVertex();

	meshBuilder.End();
	pMesh->Draw();
}
开发者ID:xxauroraxx,项目名称:Source.Python,代码行数:56,代码来源:smoke_fog_overlay.cpp


示例12: pRenderContext

void CTextureSystem::RebindDefaultCubeMap()
{
	// rebind with the default cubemap
	
	if (  m_pCubemapTexture )
	{
		CMatRenderContextPtr pRenderContext( MaterialSystemInterface() );
		pRenderContext->BindLocalCubemap( m_pCubemapTexture );
	}
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:10,代码来源:texturesystem.cpp


示例13: pRenderContext

//-----------------------------------------------------------------------------
// Purpose: Draw our special effects
//-----------------------------------------------------------------------------
void C_WeaponStunStick::DrawFirstPersonEffects( void )
{
	Vector	vecOrigin;
	QAngle	vecAngles;
	float	color[3];
	float	scale;

	CMatRenderContextPtr pRenderContext( materials );
	IMaterial *pMaterial = materials->FindMaterial( STUNSTICK_GLOW_MATERIAL_NOZ, NULL, false );
	// FIXME: Needs to work with new IMaterial system!
	pRenderContext->Bind( pMaterial );

	// Find where we are in the fade
	float fadeAmount = RemapValClamped( gpGlobals->curtime, m_flFadeTime, m_flFadeTime + FADE_DURATION, 1.0f, 0.1f );

	// Get bright when swung
	if ( InSwing() )
	{
		color[0] = color[1] = color[2] = 0.4f;
		scale = 22.0f;
	}
	else
	{
		color[0] = color[1] = color[2] = 0.4f * fadeAmount;
		scale = 20.0f;
	}
	
	if ( color[0] > 0.0f )
	{
		// Draw an all encompassing glow around the entire head
		UTIL_GetWeaponAttachment( this, m_BeamCenterAttachment, vecOrigin, vecAngles );
		DrawHalo( pMaterial, vecOrigin, scale, color );
	}

	// Draw bright points at each attachment location
	for ( int i = 0; i < (NUM_BEAM_ATTACHMENTS*2)+1; i++ )
	{
		if ( InSwing() )
		{
			color[0] = color[1] = color[2] = random->RandomFloat( 0.05f, 0.5f );
			scale = random->RandomFloat( 4.0f, 5.0f );
		}
		else
		{
			color[0] = color[1] = color[2] = random->RandomFloat( 0.05f, 0.5f ) * fadeAmount;
			scale = random->RandomFloat( 4.0f, 5.0f ) * fadeAmount;
		}

		if ( color[0] > 0.0f )
		{
			UTIL_GetWeaponAttachment( this, i, vecOrigin, vecAngles );
			DrawHalo( pMaterial, vecOrigin, scale, color );
		}
	}
}
开发者ID:NEITMod,项目名称:HL2BM2,代码行数:58,代码来源:weapon_stunstick.cpp


示例14: DrawHaloOriented

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : pMaterial - 
//			source - 
//			color - 
//-----------------------------------------------------------------------------
void DrawHaloOriented( const Vector& source, float scale, float const *color, float roll )
{
	Vector point, screen;
	
	CMatRenderContextPtr pRenderContext( materials );
	IMesh* pMesh = pRenderContext->GetDynamicMesh();

	CMeshBuilder meshBuilder;
	meshBuilder.Begin( pMesh, MATERIAL_QUADS, 1 );

	// Transform source into screen space
	ScreenTransform( source, screen );

	Vector right, up;
	float sr, cr;

	SinCos( roll, &sr, &cr );

	for ( int i = 0; i < 3; i++ )
	{
		right[i] = CurrentViewRight()[i] * cr + CurrentViewUp()[i] * sr;
		up[i] = CurrentViewRight()[i] * -sr + CurrentViewUp()[i] * cr;
	}

	meshBuilder.Color3fv (color);
	meshBuilder.TexCoord2f (0, 0, 1);
	VectorMA (source, -scale, up, point);
	VectorMA (point, -scale, right, point);
	meshBuilder.Position3fv (point.Base());
	meshBuilder.AdvanceVertex();

	meshBuilder.Color3fv (color);
	meshBuilder.TexCoord2f (0, 0, 0);
	VectorMA (source, scale, up, point);
	VectorMA (point, -scale, right, point);
	meshBuilder.Position3fv (point.Base());
	meshBuilder.AdvanceVertex();

	meshBuilder.Color3fv (color);
	meshBuilder.TexCoord2f (0, 1, 0);
	VectorMA (source, scale, up, point);
	VectorMA (point, scale, right, point);
	meshBuilder.Position3fv (point.Base());
	meshBuilder.AdvanceVertex();

	meshBuilder.Color3fv (color);
	meshBuilder.TexCoord2f (0, 1, 1);
	VectorMA (source, -scale, up, point);
	VectorMA (point, scale, right, point);
	meshBuilder.Position3fv (point.Base());
	meshBuilder.AdvanceVertex();
	
	meshBuilder.End();
	pMesh->Draw();
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:61,代码来源:c_prop_combine_ball.cpp


示例15: OverlayShowTexture

//-----------------------------------------------------------------------------
// Debugging aid to display a texture
//-----------------------------------------------------------------------------
static void OverlayShowTexture( const char* textureName, float scale )
{
	bool			foundVar;
	IMaterial		*pMaterial;
	IMaterialVar	*BaseTextureVar;
	ITexture		*pTex;
	float			x, y, w, h;

	// ___error is created in code in CMaterialSystem::CreateDebugMaterials()
	pMaterial = materials->FindMaterial( "___error", TEXTURE_GROUP_OTHER, true );
	BaseTextureVar = pMaterial->FindVar( "$basetexture", &foundVar, false );
	if (!foundVar)
		return;

	CMatRenderContextPtr pRenderContext( materials );

	if ( textureName && textureName[0] )
	{
		pTex = materials->FindTexture( textureName, TEXTURE_GROUP_OTHER, false );
		BaseTextureVar->SetTextureValue( pTex );

		w = pTex->GetActualWidth() * scale;
		h = pTex->GetActualHeight() * scale;
	}
	else
	{
		w = h = 64.0f * scale;
	}

	// Center relative to current viewport
	int nViewportX, nViewportY, nViewportWidth, nViewportHeight;
	pRenderContext->GetViewport( nViewportX, nViewportY, nViewportWidth, nViewportHeight );
	x = ( nViewportWidth - w ) * 0.5f;
	y = ( nViewportHeight - h ) * 0.5f;

	pRenderContext->Bind( pMaterial );
	IMesh* pMesh = pRenderContext->GetDynamicMesh( true );

	CMeshBuilder meshBuilder;
	meshBuilder.Begin( pMesh, MATERIAL_QUADS, 1 );
	meshBuilder.Position3f( x, y, 0.0f );
	meshBuilder.TexCoord2f( 0, 0.0f, 0.0f );
	meshBuilder.AdvanceVertex();
	meshBuilder.Position3f( x+w, y, 0.0f );
	meshBuilder.TexCoord2f( 0, 1.0f, 0.0f );
	meshBuilder.AdvanceVertex();
	meshBuilder.Position3f( x+w, y+h, 0.0f );
	meshBuilder.TexCoord2f( 0, 1.0f, 1.0f );
	meshBuilder.AdvanceVertex();
	meshBuilder.Position3f( x, y+h, 0.0f );
	meshBuilder.TexCoord2f( 0, 0.0f, 1.0f );
	meshBuilder.AdvanceVertex();
	meshBuilder.End();
	pMesh->Draw();
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:58,代码来源:viewdebug.cpp


示例16: SetupLighting

//-----------------------------------------------------------------------------
// Setup lighting
//-----------------------------------------------------------------------------
static void SetupLighting( int lightingCombination, Vector &lightOffset )
{
	CMatRenderContextPtr pRenderContext( g_pMaterialSystem );
	if( lightingCombination == 0 )
	{
		g_pStudioRender->SetLocalLights( 0, NULL );
		pRenderContext->SetAmbientLight( 1.0, 1.0, 1.0 );

		static Vector white[6] = 
		{
			Vector( 1.0, 1.0, 1.0 ),
			Vector( 1.0, 1.0, 1.0 ),
			Vector( 1.0, 1.0, 1.0 ),
			Vector( 1.0, 1.0, 1.0 ),
			Vector( 1.0, 1.0, 1.0 ),
			Vector( 1.0, 1.0, 1.0 ),
		};
		g_pStudioRender->SetAmbientLightColors( white );
	}
	else
	{
		pRenderContext->SetAmbientLight( 0.0f, 0.0f, 0.0f );

		static Vector black[6] = 
		{
			Vector( 0.0, 0.0, 0.0 ),
			Vector( 0.0, 0.0, 0.0 ),
			Vector( 0.0, 0.0, 0.0 ),
			Vector( 0.0, 0.0, 0.0 ),
			Vector( 0.0, 0.0, 0.0 ),
			Vector( 0.0, 0.0, 0.0 ),
		};
		g_pStudioRender->SetAmbientLightColors( black );

		int lightID;
		LightDesc_t lightDescs[MAX_LIGHTS];
		for( lightID = 0; lightID < MAX_LIGHTS; lightID++ )
		{
			int lightType = g_LightCombinations[lightingCombination][lightID];
			lightDescs[lightID] = g_TestLights[lightType][lightID];
			lightDescs[lightID].m_Position += lightOffset;
		}
			    
		// Feed disabled lights through?
		if( g_LightCombinations[lightingCombination][1] == MATERIAL_LIGHT_DISABLE )
		{
			g_pStudioRender->SetLocalLights( 1, lightDescs );
		}
		else
		{
			g_pStudioRender->SetLocalLights( MAX_LIGHTS, lightDescs );
		}
	}
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:57,代码来源:ihvtest1.cpp


示例17: pRenderContext

void CReplayRenderer::BeginRenderingSample( int nSample, int x, int y, int nWidth, int nHeight, float fTonemapScale )
{
	// Always start on ping-pong buffer zero
	if ( nSample == 0 )
	{
		m_nCurrentPingPong = 0;
	}

	CMatRenderContextPtr pRenderContext( g_pMaterialSystem );
	pRenderContext->PushRenderTargetAndViewport( m_AccumBuffSample, x, y, nWidth, nHeight );
}
开发者ID:1n73rf4c3,项目名称:source-sdk-2013,代码行数:11,代码来源:replayrenderer.cpp


示例18: DrawHalo

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : pMaterial - 
//			source - 
//			color - 
//-----------------------------------------------------------------------------
void DrawHalo(IMaterial* pMaterial, const Vector& source, float scale, float const* color, float flHDRColorScale )
{
	static unsigned int nHDRColorScaleCache = 0;
	Vector		point, screen;
	
	if( pMaterial )
	{
		IMaterialVar *pHDRColorScaleVar = pMaterial->FindVarFast( "$hdrcolorscale", &nHDRColorScaleCache );
		if( pHDRColorScaleVar )
		{
			pHDRColorScaleVar->SetFloatValue( flHDRColorScale );
		}
	}

	CMatRenderContextPtr pRenderContext( materials );
	IMesh* pMesh = pRenderContext->GetDynamicMesh( );

	CMeshBuilder meshBuilder;
	meshBuilder.Begin( pMesh, MATERIAL_QUADS, 1 );

	// Transform source into screen space
	ScreenTransform( source, screen );

	meshBuilder.Color3fv (color);
	meshBuilder.TexCoord2f (0, 0, 1);
	VectorMA (source, -scale, CurrentViewUp(), point);
	VectorMA (point, -scale, CurrentViewRight(), point);
	meshBuilder.Position3fv (point.Base());
	meshBuilder.AdvanceVertex();

	meshBuilder.Color3fv (color);
	meshBuilder.TexCoord2f (0, 0, 0);
	VectorMA (source, scale, CurrentViewUp(), point);
	VectorMA (point, -scale, CurrentViewRight(), point);
	meshBuilder.Position3fv (point.Base());
	meshBuilder.AdvanceVertex();

	meshBuilder.Color3fv (color);
	meshBuilder.TexCoord2f (0, 1, 0);
	VectorMA (source, scale, CurrentViewUp(), point);
	VectorMA (point, scale, CurrentViewRight(), point);
	meshBuilder.Position3fv (point.Base());
	meshBuilder.AdvanceVertex();

	meshBuilder.Color3fv (color);
	meshBuilder.TexCoord2f (0, 1, 1);
	VectorMA (source, -scale, CurrentViewUp(), point);
	VectorMA (point, scale, CurrentViewRight(), point);
	meshBuilder.Position3fv (point.Base());
	meshBuilder.AdvanceVertex();
	
	meshBuilder.End();
	pMesh->Draw();
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:60,代码来源:beamdraw.cpp


示例19: pRenderContext

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
int C_BaseViewModel::InternalDrawModel( int flags )
{
	CMatRenderContextPtr pRenderContext( materials );
	if ( ShouldFlipViewModel() )
		pRenderContext->CullMode( MATERIAL_CULLMODE_CW );

	int ret = BaseClass::InternalDrawModel( flags );

	pRenderContext->CullMode( MATERIAL_CULLMODE_CCW );

	return ret;
}
开发者ID:malortie,项目名称:ulaval,代码行数:15,代码来源:c_baseviewmodel.cpp


示例20: pRenderContext

CPixelVisibilityQuery::~CPixelVisibilityQuery()
{
	CMatRenderContextPtr pRenderContext( materials );
	if ( m_queryHandle != INVALID_OCCLUSION_QUERY_OBJECT_HANDLE )
	{
		pRenderContext->DestroyOcclusionQueryObject( m_queryHandle );
	}
	if ( m_queryHandleCount != INVALID_OCCLUSION_QUERY_OBJECT_HANDLE )
	{
		pRenderContext->DestroyOcclusionQueryObject( m_queryHandleCount );
	}
}
开发者ID:1n73rf4c3,项目名称:source-sdk-2013,代码行数:12,代码来源:c_pixel_visibility.cpp



注:本文中的pRenderContext函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pTrack函数代码示例发布时间:2022-05-30
下一篇:
C++ pLock函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap