Fake stones. Constraining texture on stones by altitude.

Started by Alfamike, September 16, 2008, 11:06:22 AM

Previous topic - Next topic

Alfamike

Hello,

On my "current project" I want to restrict some texturing on largeish fake stones by minimum altitude. The stones are of scale 2 and tallness 2.

The Surface Layer shader seems to constrain by slope but not by altitude. This also happens when I put a Compute Terrain after the Fake Stones shader (since there is now significant change in normals) or when I create the stones in the terrain part before the -usually- single Compute Terrain.

When the Surface Layer shader has constrained by slope properly, then activation of any the minimum altitude constraint (what ever the value) seems to undo this.

Any ideas about a work-around to select elevation (bands) on fake stones?

Thanks for reading and your help.

AM.
[attach=#]

Matt

The problem is that the Surface Layer uses texture coordinates (or computed terrain coordinates) rather than "final" displaced coordinates, so that it can match displacement and colour. If you use the Distribution Shader V4 instead you'll find an option to change the altitude key between "Final position" and "Position in texture/terrain". This is a relatively new option (previously it was only possible to change the slope key, and only in the Surface Layer). I don't remember the exact reason why I didn't add this to the Surface Layer yet (there was a reason...), but I will probably do so for the next release.

Over a larger area "Position in texture/terrain" will give approximately the right results. It depends on how large the patch size is in Compute Terrain. For now, if you can use the Distribution Shader V4 that should allow you to make it work.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Alfamike

Thanks Matt, hearing from the makers is always good! Ta.