コード例 #1
0
ファイル: render.cpp プロジェクト: newobj/taz
	void RenderText(IText* pText)
	{
		_ASSERT(pText->GetFont());
		_ASSERT(pText->GetFont()->GetShader());

		RenderShader(pText->GetFont()->GetShader(), pText->GetTint(), CRender::RenderFacesText, pText);
	}
コード例 #2
0
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;
}
コード例 #3
0
	void MultiTextureShader::Render(Graphics* graphics)
	{
		SetShaderParameters(graphics);

		// render the buffers
		RenderShader(graphics);
	}
コード例 #4
0
	void AlphaMapShader::Render(Graphics* graphics)
	{

		SetShaderParameters(graphics);

		RenderShader(graphics);
	}
コード例 #5
0
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;
}
コード例 #6
0
ファイル: SLight.cpp プロジェクト: Elbe2/Gundby
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;
}
コード例 #7
0
void FoliageShaderClass::Render(ID3D10Device* device, int vertexCount, int instanceCount, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix, ID3D10ShaderResourceView* texture)
{
	SetShaderParameters(viewMatrix, projectionMatrix, texture);
	RenderShader(device, vertexCount, instanceCount);

	return;
}
コード例 #8
0
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;
}
コード例 #9
0
ファイル: PreviewObject.cpp プロジェクト: GlenDC/Lemmings3D
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());
}
コード例 #10
0
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;
}
コード例 #11
0
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;
}
コード例 #12
0
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;
}
コード例 #13
0
// 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;
}
コード例 #14
0
ファイル: Shader.cpp プロジェクト: ValCanBuild/DirectXWork
/*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);
}
コード例 #15
0
ファイル: textureshaderclass.cpp プロジェクト: Jaymz/DX10
void TextureShaderClass::Render(ID3D10Device* device, int indexCount, 
								D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix, 
								ID3D10ShaderResourceView* texture) {
	SetShaderParameters(worldMatrix, viewMatrix, projectionMatrix, texture);

	RenderShader(device, indexCount);

	return;
}
コード例 #16
0
ファイル: ColorShader.cpp プロジェクト: dblalock08/cavalcade
void ColorShader::Render(ID3D11DeviceContext* deviceContext, int indexCount,
						 XMFLOAT4X4 worldMatrix, XMFLOAT4X4 viewMatrix, XMFLOAT4X4 projectionMatrix)
{
	SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix);

	RenderShader(deviceContext, indexCount);

	return;
}
コード例 #17
0
ファイル: fontshaderclass.cpp プロジェクト: vu1p3n0x/GameGame
bool FontShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix, ID3D11ShaderResourceView* texture, D3DXVECTOR4 pixelColor)
{
	if(!SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture, pixelColor))
		return false;

	RenderShader(deviceContext, indexCount);

	return true;
}
コード例 #18
0
void LightShader::Render(ID3D10Device* device, int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix, 
						 D3DXVECTOR3 mEyePos, Light lightVar, int lightType){

	// Set the shader parameters that it will use for rendering.
	SetShaderParameters(worldMatrix, viewMatrix, projectionMatrix, mEyePos, lightVar, lightType);

	// Now render the prepared buffers with the shader.
	RenderShader(device, indexCount);
}
コード例 #19
0
void TransparentDepthShaderClass::Render(ID3D10Device* device, int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix, ID3D10ShaderResourceView* texture)
{
    // Set the shader parameters that it will use for rendering.
    SetShaderParameters(worldMatrix, viewMatrix, projectionMatrix, texture);

    // Now render the prepared buffers with the shader.
    RenderShader(device, indexCount);

    return;
}
コード例 #20
0
bool LightShader::Update(ID3D11DeviceContext* deviceContext, int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, 
			      D3DXMATRIX projectionMatrix, ID3D11ShaderResourceView* texture, D3DXVECTOR3 lightDirection, D3DXVECTOR4 diffuseColor)
{
	// Set the shader parameters that it will use for rendering.
	SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture, lightDirection, diffuseColor);

	// Now render the prepared buffers with the shader.
	RenderShader(deviceContext, indexCount);
	return true;
}
コード例 #21
0
ファイル: FontShader.cpp プロジェクト: SeraphXIV/Engine
//////////////////////////////////////////////////////////////////////////////////////////
//			Affichage																	//
//////////////////////////////////////////////////////////////////////////////////////////
void CFontShader::Render(ID3D10Device* device, int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix,
			     D3DXMATRIX projectionMatrix, ID3D10ShaderResourceView* texture, D3DXVECTOR4 pixelColor)
{
	// Set the shader parameters that it will use for rendering.
	SetShaderParameters(worldMatrix, viewMatrix, projectionMatrix, texture, pixelColor);
	// Now render the prepared buffers with the shader.
	RenderShader(device, indexCount);

	return;
}
コード例 #22
0
void HorizontalBlurShaderClass::Render(ID3D10Device* device, int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix,
                                       D3DXMATRIX projectionMatrix, ID3D10ShaderResourceView* texture, float screenWidth)
{
    // Set the shader parameters that it will use for rendering.
    SetShaderParameters(worldMatrix, viewMatrix, projectionMatrix, texture, screenWidth);

    // Now render the prepared buffers with the shader.
    RenderShader(device, indexCount);

    return;
}
コード例 #23
0
void LightShaderClass::Render(ID3D10Device* device, int indexCount, D3DXMATRIX worldMatrix,
	D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix, D3DXVECTOR4 ambientColor, D3DXVECTOR4 diffuseColor, D3DXVECTOR3 lightDirection)
{
	// 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);

	return;
}
コード例 #24
0
void RefractionShaderClass::Render(ID3D10Device* device, int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix,
								   D3DXMATRIX projectionMatrix, ID3D10ShaderResourceView* texture, D3DXVECTOR3 lightDirection,
								   D3DXVECTOR4 ambientColor, D3DXVECTOR4 diffuseColor, D3DXVECTOR4 clipPlane)
{
	// Set the shader parameters that it will use for rendering.
	SetShaderParameters(worldMatrix, viewMatrix, projectionMatrix, texture, lightDirection, ambientColor, diffuseColor, clipPlane);

	// Now render the prepared buffers with the shader.
	RenderShader(device, indexCount);

	return;
}
コード例 #25
0
bool D3DTextureShader::Render(ID3D11DeviceContext* deviceContext, int indexCount, const XMMATRIX &worldMatrix, const XMMATRIX &viewMatrix, 
								const XMMATRIX &projectionMatrix, ID3D11ShaderResourceView* texture)
{
	// Set the shader parameters that it will use for rendering.
	bool result = SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture);
	if(!result)
		return false;

	RenderShader(deviceContext, indexCount);

	return true;
}
コード例 #26
0
ファイル: render.cpp プロジェクト: newobj/taz
	void RenderCustomDraw(CCustomDraw* pCustomDraw)
	{
		_ASSERT(pCustomDraw->GetNumShaders());

		for ( int iShader = 0 ; iShader < pCustomDraw->GetNumShaders() ; ++iShader )
		{
			CDCB cdcb;
			cdcb.pCustomDraw = pCustomDraw;
			cdcb.iPiece = iShader;
			RenderShader(pCustomDraw->GetShader(iShader), pCustomDraw->GetTint(), RenderFacesCustomDraw, &cdcb);
		}

	}
コード例 #27
0
ファイル: TextureShader.cpp プロジェクト: we-won/dxframework
bool TextureShader::Render(ID3D11DeviceContext* deviceContext, XMFLOAT4X4 worldMatrix, XMFLOAT4X4 viewMatrix, 
							XMFLOAT4X4 projectionMatrix, int indexCount, ID3D11ShaderResourceView* texture, 
							XMFLOAT4X4 lightViewMatrix, XMFLOAT4X4 lightProjectionMatrix, 
							ID3D11ShaderResourceView* depthMapTexture)
{
	if (!SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture, lightViewMatrix, lightProjectionMatrix, depthMapTexture))
	{
		return false;
	}

	RenderShader(deviceContext, indexCount);

	return true;
}
コード例 #28
0
ファイル: FontShaderClass.cpp プロジェクト: SonWonJong/Test
bool FontShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix,
	XMMATRIX projectionMatrix, ID3D11ShaderResourceView* texture, XMFLOAT4 pixelColor)
{
	// 렌더링에 사용할 셰이더 매개 변수를 설정합니다.
	if (!SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture, pixelColor))
	{
		return false;
	}

	// 설정된 버퍼를 셰이더로 렌더링한다.
	RenderShader(deviceContext, indexCount);

	return true;
}
コード例 #29
0
	bool ModelMaterial::Render(ID3D11DeviceContext* a_pDeviceContext, int a_nIndexCount, XMFLOAT4X4 a_mWorldMatrix, XMFLOAT4X4 a_mViewMatrix, XMFLOAT4X4 a_mProjectionMatrix)
	{
		bool result;

		result = SetShaderParameters(a_pDeviceContext, a_mWorldMatrix, a_mViewMatrix, a_mProjectionMatrix);
		if(!result)
		{
			return false;
		}

		RenderShader(a_pDeviceContext, a_nIndexCount);

		return true;
	}
コード例 #30
0
bool ColorShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix)
{
	bool result;

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

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

	return true;
}