Using Plane to generate texCoord on SkyDome

Started by
13 comments, last by _DarkWIng_ 18 years, 10 months ago
Quote:Original post by Halsafar
Is what you posted ALL you did to calculate the texU and texV coords?

Yes, it only calculates texture coordinates and alpha.

Quote:Original post by Halsafar
There is no actual ray-plane collision test's to perform?

There is but it's optimized to plane with (0,1,0) normal. here: distMult = someNumber / vertex.y; Since dome is in origin the ray normal is same as vertex. And since plane is horizontal I just need y component. I divide the plane height with y to get the multiplier (how for from origin the collision point is). The rest is the same.

Quote:Original post by Halsafar
Edit: However, I am setting the view matrix each time I render as to keep the sphere centered around on the viewer, like the trick with billboard's or quad particles. Is this right? The texture always looks so close now and blurry. Because of the fact it is so close it is hard to see any flatness in it all like in your screeny.

I'm not 100% sure how you do it but I used something like this: store and reset the view matrix then use just rotation part of my camera. Then I draw the dome and reset the stored matrix. If you can't directly calculate rotation matrix from camera then you can use normal view matrix and modify it. Just set translation part to zero.

Could you post a shot of how it looks now.
You should never let your fears become the boundaries of your dreams.
Advertisement
That all makes a ton of sense.
Here is a screeny of just simple alpha fading into the distance, some different value's than u used in your snippet some tweaking may still be needed.
I wanna add some color to it or get it blue somehow but thats another matter.

Looks great! Nice to see it working.

Making it 'blue' is another thing. You need to somehow get sky color and clouds color to get the right look. So you need something like 'color = sky_color + ( coluds_texture * clouds_color * alpha )'. Try using skydome for per-vertex coloring so you get a nice sky gradient.

edit: and make sure you set alpha to 0 on vertices under the horizon (y<0) or you 'll get a nasty mirroring effect.
You should never let your fears become the boundaries of your dreams.
Yes I had noticed that.

This is how I force the sky around the player:
::Graphics()->GetTransform(D3DTS_VIEW, &matViewSave);

matView = matViewSave;
matView._41 = 0;
matView._42 = 0;
matView._43 = 0;

::Graphics()->SetTransform( D3DTS_VIEW, &matView );


Now as for the horizon, is the horizon simply the point where the terrain and the sky meet?
The way I have it set up, the end of the dome is NOT perfectly lined up with the terrain in fact the dome is bigger so some of it is under the terrain (with alpha of 0 so it is invisible, mostly) Now there is an effect at the horizon which must be met?


Lastly, in the shots you posted awhile back your scene had a nice orangy-glow trailing down into the distance. Is this the per-vertex color gradient used?
Quote:Original post by Halsafar
Now as for the horizon, is the horizon simply the point where the terrain and the sky meet?

I was thinking the horizon point, the point on skydome that has y=0. In general case if this will be around your view horizon, as some of the terrain will be a little above it and some a bit under it (depending on how high over terrain your camera is).

Quote:Original post by Halsafar
Lastly, in the shots you posted awhile back your scene had a nice orangy-glow trailing down into the distance. Is this the per-vertex color gradient used?

I used sky gradient based on "A practical analytic model for daylight" paper.
You should never let your fears become the boundaries of your dreams.

This topic is closed to new replies.

Advertisement