Ejemplo n.º 1
0
bool SkyPlane::Init(ID3D11Device* device, LPCSTR* cloudTextureFilename, LPCSTR* perturbTextureFilename)
{
	int skyPlaneResolution, textureRepeat;
	float skyPlaneWidth, skyPlaneTop, skyPlaneBottom;
	bool result;


	// Set the sky plane parameters.
	skyPlaneResolution = 50;
	skyPlaneWidth = 10.0f;
	skyPlaneTop = 0.5f;
	skyPlaneBottom = 0.0f;
	textureRepeat = 2;

	// Set the sky plane shader related parameters.
	m_scale = 0.3f;
	m_brightness = 0.5f;

	// Initialize the translation to zero.
	m_translation = 0.0f;

	// Create the sky plane.
	result = InitializeSkyPlane(skyPlaneResolution, skyPlaneWidth, skyPlaneTop, skyPlaneBottom, textureRepeat);
	if(!result)
	{
		return false;
	}

	// Create the vertex and index buffer for the sky plane.
	result = InitializeBuffers(device, skyPlaneResolution);
	if(!result)
	{
		return false;
	}

	// Load the sky plane textures.
	result = LoadTextures(device, cloudTextureFilename, perturbTextureFilename);
	if(!result)
	{
		return false;
	}

	return true;
}
Ejemplo n.º 2
0
	void Clouds::CreateDevice(ID3D11Device* device)
	{
		UINT skyPlaneResolution, textureRepeat;
		float skyPlaneWidth, skyPlaneTop, skyPlaneBottom;

		// Set the sky plane parameters.
		skyPlaneResolution = 50;
		skyPlaneWidth = 10.0f;
		skyPlaneTop = 0.5f;
		skyPlaneBottom = -0.5f;
		textureRepeat = 2;

		// Set the sky plane shader related parameters.
		m_ConstantBuffer.Data.scale = 0.3f;
		m_ConstantBuffer.Data.brightness = 0.5f;

		// Initialize the translation to zero.
		m_ConstantBuffer.Data.translation = 0.0f;

		InitializeSkyPlane(device, skyPlaneResolution, skyPlaneWidth, skyPlaneTop, skyPlaneBottom, textureRepeat);
	}