当前位置: 首页>>代码示例>>C++>>正文


C++ RenderShader函数代码示例

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


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

示例1: RenderText

	void RenderText(IText* pText)
	{
		_ASSERT(pText->GetFont());
		_ASSERT(pText->GetFont()->GetShader());

		RenderShader(pText->GetFont()->GetShader(), pText->GetTint(), CRender::RenderFacesText, pText);
	}
开发者ID:newobj,项目名称:taz,代码行数:7,代码来源:render.cpp

示例2: SetShaderParameters

bool ParticleShaderClass::Render(
	ID3D11DeviceContext* deviceContext,
	int indexCount,
	D3DXMATRIX worldMatrix,
	D3DXMATRIX viewMatrix,
	D3DXMATRIX projectionMatrix,
	ID3D11ShaderResourceView* texture
	)
{
	bool result;

	result = SetShaderParameters( //set the shader parameters that it will use for rendering
		deviceContext,
		worldMatrix,
		viewMatrix,
		projectionMatrix,
		texture
		);
	if(!result)
	{
		return false;
	}

	RenderShader(deviceContext, indexCount); //render the prepared buffers with the shader

	return true;
}
开发者ID:NukePie,项目名称:Engine,代码行数:27,代码来源:ParticleShaderClass.cpp

示例3: SetShaderParameters

	void MultiTextureShader::Render(Graphics* graphics)
	{
		SetShaderParameters(graphics);

		// render the buffers
		RenderShader(graphics);
	}
开发者ID:Alriightyman,项目名称:GameEngine,代码行数:7,代码来源:MultiTextureShader.cpp

示例4: SetShaderParameters

	void AlphaMapShader::Render(Graphics* graphics)
	{

		SetShaderParameters(graphics);

		RenderShader(graphics);
	}
开发者ID:Alriightyman,项目名称:GameEngine,代码行数:7,代码来源:AlphaMapShader.cpp

示例5: RenderShader

bool OrthoColorShader::Render(ID3D11DeviceContext* context, int indexCount, Matrix *worldMatrix) {
	// setup matrix buffer
	D3D11_MAPPED_SUBRESOURCE mappedResource;
	unsigned int bufferNumber = 0;

	// Lock the constant buffer so it can be written to.
	HRESULT result = context->Map(mMatrixBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
	if(FAILED(result)) {
		return false;
	}

	// Get a pointer to the data in the constant buffer.
	MatrixBufferType* dataPtr = (MatrixBufferType*)mappedResource.pData;

	// Transpose the matrix to prepare them for the shader.
	worldMatrix->Transpose(dataPtr->world);
	//D3DXMatrixTranspose(&dataPtr->world, worldMatrix);

	// Unlock the constant buffer.
	context->Unmap(mMatrixBuffer, 0);

	// Finally set the constant buffer in the vertex shader with the updated values.
	context->VSSetConstantBuffers(bufferNumber, 1, &(mMatrixBuffer.p));

	// Render
	RenderShader(context,indexCount);

	return true;
}
开发者ID:ValCanBuild,项目名称:Fluid-Simulation-DirectX11,代码行数:29,代码来源:OrthoColorShader.cpp

示例6: RenderShader

bool CSLightD::Render(ID3D11DeviceContext *devicecontext,int indexCount,XMMATRIX worldmat,XMMATRIX viewmat,XMMATRIX projmat,ID3D11ShaderResourceView *texture,XMFLOAT3 lightDir,XMFLOAT4 diffuseCol,XMFLOAT4 ambientCol)
{
	if(!SetShaderParameters(devicecontext,worldmat,viewmat,projmat,texture,lightDir,diffuseCol,ambientCol))
		return false;
	RenderShader(devicecontext,indexCount);
	return true;
}
开发者ID:Elbe2,项目名称:Gundby,代码行数:7,代码来源:SLight.cpp

示例7: SetShaderParameters

void FoliageShaderClass::Render(ID3D10Device* device, int vertexCount, int instanceCount, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix, ID3D10ShaderResourceView* texture)
{
	SetShaderParameters(viewMatrix, projectionMatrix, texture);
	RenderShader(device, vertexCount, instanceCount);

	return;
}
开发者ID:TimothyOneill,项目名称:TimsWorkspace,代码行数:7,代码来源:FoliageShaderClass.cpp

示例8: SetShaderParameters

bool ProjectionLightMapShaderClass::Render(
	ID3D11DeviceContext* deviceContext,
	int indexCount,
	XMMATRIX &worldMatrix,
	XMMATRIX &viewMatrix,
	XMMATRIX &projectionMatrix,
	ID3D11ShaderResourceView* texture,
	XMFLOAT4 &ambientColour,
	XMFLOAT4 &diffuseColour,
	XMFLOAT3 &lightPosition,
	XMMATRIX &projTexViewMatrix,
	XMMATRIX &projTexProjectionMatrix,
	ID3D11ShaderResourceView* projectionTexture){
	bool result;

	//set shader params
	result = SetShaderParameters(
		deviceContext,
		worldMatrix,
		viewMatrix,
		projectionMatrix,
		texture,
		ambientColour,
		diffuseColour,
		lightPosition,
		projTexViewMatrix,
		projTexProjectionMatrix,
		projectionTexture);
	if (!result) return false;

	//render prepped buffers with shader
	RenderShader(deviceContext, indexCount);

	return true;
}
开发者ID:braedy,项目名称:directx11-personal,代码行数:35,代码来源:projectionlightmapshaderclass.cpp

示例9: RenderBuffers

void PreviewObject::Draw(const GameContext & context)
{
	// Put the vertex and instance buffers on the graphics pipeline to prepare them for drawing.
	RenderBuffers(GraphicsDevice::GetInstance()->GetDevice());
	m_pMaterial->SetPosition(m_Position);
	m_pMaterial->SetEffectVariables(context, nullptr);
	RenderShader(GraphicsDevice::GetInstance()->GetDevice());
}
开发者ID:GlenDC,项目名称:Lemmings3D,代码行数:8,代码来源:PreviewObject.cpp

示例10: SetShaderParams

void TextureShader::Render(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX* worldMatrix, XMMATRIX* viewMatrix, XMMATRIX* projMatrix, 
	ID3D11ShaderResourceView* texture, Light* light, XMFLOAT3 cameraPosition, float alpha)
{
	SetShaderParams(deviceContext, worldMatrix, viewMatrix, projMatrix, texture, light, cameraPosition, alpha);

	RenderShader(deviceContext, indexCount);
	return;
}
开发者ID:klaxorx,项目名称:Water-Wave-Simulation,代码行数:8,代码来源:TextureShader.cpp

示例11: RenderShader

bool ColorShader::Render(ID3D11DeviceContext *deviceContext, int indexCount, DirectX::XMMATRIX worldMatrix, DirectX::XMMATRIX viewMatrix, DirectX::XMMATRIX projectionMatrix)
{
	if (!SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix))
		return false;
	RenderShader(deviceContext, indexCount);

	return true;
}
开发者ID:dillonwd6086,项目名称:3D-Engine-DX11,代码行数:8,代码来源:ColorShader.cpp

示例12: SetShaderParameters

bool TextureShaderClass::Render(HWND hwnd, ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX& worldMatrix, XMMATRIX& viewMatrix, XMMATRIX& projectionMatrix, ID3D11ShaderResourceView* texture, float blend, XMFLOAT4 hueColor, bool xFlip, bool yFlip){
	bool result = SetShaderParameters(hwnd, deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture, blend, hueColor, xFlip, yFlip);
	if (!result){
		return false;
	}
	RenderShader(deviceContext, indexCount);
	return true;
}
开发者ID:UnlikeSuika,项目名称:General_Direct3D,代码行数:8,代码来源:TextureShaderClass.cpp

示例13: SetShaderParameters

// Takes the required variables to set the shader parameters and render the buffers using the shader file
void LightShaderClass::Render(ID3D10Device* device, int indexCount, int vertexCount, int instanceCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix, 
							  ID3D10ShaderResourceView** textureArray, D3DXVECTOR3 lightDirection, D3DXVECTOR4 ambientColor, D3DXVECTOR4 diffuseColor, D3DXVECTOR3 cameraPosition,
								D3DXVECTOR4 specularColor, float specularPower){
	
	SetShaderParameters(worldMatrix, viewMatrix, projectionMatrix, textureArray, lightDirection, ambientColor, diffuseColor, cameraPosition, specularColor, specularPower);
	RenderShader(device, indexCount, vertexCount, instanceCount);
	return;
}
开发者ID:TimothyOneill,项目名称:TimsWorkspace,代码行数:9,代码来源:LightShaderClass.cpp

示例14: SetShaderParameters

/*Render will first set the parameters inside the shader using the SetShaderParameters function. 
Once the parameters are set it then calls RenderShader to draw using the HLSL shader.*/
void Shader::Render(ID3D10Device* device, int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix)
{
	// Set the shader parameters that it will use for rendering.
	SetShaderParameters(worldMatrix, viewMatrix, projectionMatrix);

	// Now render the prepared buffers with the shader.
	RenderShader(device, indexCount);
}
开发者ID:ValCanBuild,项目名称:DirectXWork,代码行数:10,代码来源:Shader.cpp

示例15: SetShaderParameters

void TextureShaderClass::Render(ID3D10Device* device, int indexCount, 
								D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix, 
								ID3D10ShaderResourceView* texture) {
	SetShaderParameters(worldMatrix, viewMatrix, projectionMatrix, texture);

	RenderShader(device, indexCount);

	return;
}
开发者ID:Jaymz,项目名称:DX10,代码行数:9,代码来源:textureshaderclass.cpp


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