SkyX terrain pass depth conflicts (pass 1 seems to fight 2)

mightygoose

07-06-2012 23:29:01

Hey Ogres and mOgres!

I've been playing around with SkyX a lot lately (I've written a small SkyX wrapper for 0.3 available in the Mogre forum) and I've ran into a problem with the ground pass. There seems to be a conflict with it and the default pass of my ground material as seen in Figure 1.


Figure 1: Conflict between pass 1 and 2 of my ground material. Ignore the oddities caused by the UV coordinate, I was experimenting with something else at the same time when I took this screenshot. There are problems even with proper UV coordinates.

The material script I am using is:

material grass
{
// first, preferred technique
technique
{
// first pass
pass
{
depth_write on
depth_check on

// Texture unit 0
texture_unit
{
texture sand.jpg
scale 1 1
}
}
}
}


The scale of the world that I'm working with is huge... The player has a visible range of 10 miles or more, at 1 game unit per meter (roughly 16,000 Ogre units). I don't know, maybe this is just a single floating point precision error caused by the scale of the world? Maybe this is better posted in the Ogre forums as maybe it is a glitch with Ogre and large scale scenes? The terrain is being rendered using a ManualObject.

Thank you in advanced, to anyone who can help,
Jon

mightygoose

03-07-2012 19:22:57

I figured out a workaround (I'd hardly call it a solution). I manually set the depth bias of the pass after its been created by SkyX. It seems to do the trick, but I'm eager to hear of a better solution if it exist since this seems kind of like a hack and sometime I get flickers of pixels the dont have the pass applied to them.