# Skydome depth and Daytime Shader Question

This topic is 3166 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Ok this is actually 2 questions I have. 1. I've got a skydome over my terrain with a sky texture pasted on it. I defined ZEnable = false in the shader so I won't see the depth difference to the horizon but you can still see that there's a dome all around me. How can I do something against that? 2. solved. [Edited by - lipsryme on April 17, 2010 8:35:20 AM]

##### Share on other sites
Not sure about the first question, but for the second part you could pass in a normalized (0 - 1) float value representing the time of day, with 1 being the brightest time and 0 being the darkest time. Then do something like color += dayColor * time + nightColor * (1 - time) to get your final color.

##### Share on other sites
Well I've managed to make it work and look good with the lerp function, interpolating between the color values.
But I still don't get how I can make the skydome look right...?
I've read that you have to draw the dome at your camera's position but if I'd do that wouldn't that move the dome all around and inside other geometry like the terrain ???

##### Share on other sites
You should post some of your code so we can see exactly the way you made your skydome.

##### Share on other sites
Not sure why this drawing code would help but here it is:

void CGraphics::DrawSkydome(){	// Set Variables	D3DXMatrixScaling(&m_matScale, 120.0f, 120.0f, 120.0f);	D3DXMatrixTranslation(&m_matTranslation, m_vec3CamPosition.x, m_vec3CamPosition.y, m_vec3CamPosition.z);	m_matWorld = m_matScale * m_matTranslation;	m_pD3DEffect->SetMatrix("xWorld", &m_matWorld);	// Set Technique	if(SUCCEEDED(m_pD3DEffect->SetTechnique("Skydome")))	{		UINT numberOfPasses;		m_pD3DEffect->Begin(&numberOfPasses, NULL);		for(UINT i = 0; i < numberOfPasses; i ++)		{			m_pD3DEffect->BeginPass(i);			// --> Draw Mesh here <--			m_pCMesh->RenderSkydomeMesh(m_pD3DDev9);							m_pD3DEffect->EndPass();		}		m_pD3DEffect->End();	}}

##### Share on other sites
The camera always has to be in the center of the dome. So the dome will move with your camera. But since you don't write the depth buffer while rendering the dome, there's no problem (it won't intersect anything).

Or did I misunderstood something?

##### Share on other sites
Yes I get that but now when I move the camera up and down for example my skydome moves with me.
Which results in the problem that my terrain does not (even if it did I couldn't move forward then can I ?) and the sky doesn't fit anymore.

##### Share on other sites
I don't understand. The dome doesn't fit to what?

##### Share on other sites
^^ it doesn't fit to the rest of the scene because I move the skydome.
But I think I got it now. If I use an offset on the Y-value of the Skydome position I can somehow fit it to the scene.

##### Share on other sites
The skydome has to fit to the camera. Because it models an infinitely large dome. (just like a star-textured-sphere)

If it's fit to the scene, then it's simply a dome with a sky poster on it, which will fail miserably if you have large outdoor scenes (because you can go outside the dome).

Or maybe I still misunderstand the problem.

1. 1
2. 2
Rutin
19
3. 3
4. 4
khawk
14
5. 5
A4L
13

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633743
• Total Posts
3013643
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!