Extracting grayscale map from displacements

Started by moodflow, November 18, 2008, 07:21:14 PM

Previous topic - Next topic

moodflow

Would anyone have any ideas on how to do this?  Everything I've tried so far has failed.

A good example is the alpine fractal shader.  Since its only a displacement effect, there is no associated color, therefore it can't be used as a mask. 
http://www.moodflow.com
mood-inspiring images and music

bigben

What sort of mask are you trying to make? You can convert it to something usable as a mask with various functions.

moodflow

It would be a grayscale map of the alpine fractal's displacements, similar to how the power fractal shader does it.   The darker the color the lower the altitude, and the lighter the color, the higher the altitude.  It would be nice to use these inherent "altitudes" in the alpine fractal to create a varying black and white map.  This map could be used as a blend shader.

For instance, the power fractal shader can be used both as displacement and/or as a grayscale map - colors are build in.  Using it as a grayscale map, you can plug it into other shaders' blend shader input to mask them based on the fractal. 

It seems the alpine fractal is the only node that doesn't output a grayscale map like all of the other fractals.
http://www.moodflow.com
mood-inspiring images and music

old_blaggard

You could apply a completely black surface to it and then create a surface layer that got brighter as you went up.
http://www.terragen.org - A great Terragen resource with models, contests, galleries, and forums.

JimB

How about an ortho render from above. Make the entire surface a Constant white. Switch off all lights, reduce atmospheric density to zero. Make the Haze colour black, and play with the density and height of the Haze?
Some bits and bobs
The Galileo Fallacy, 'Argumentum ad Galileus':
"They laughed at Galileo. They're laughing at me. Therefore I am the next Galileo."

Nope. Galileo was right for the simpler reason that he was right.

bigben

#5
OK, I am assuming you want to make a mask of the fractal to apply to subsequent displacements?  The simplest thing would be a distribution shader.  To do this before the compute terrain node you need to add a Tex coords from XYZ and connect that to the input of a distribution shader, setting altitude restrictions to match your terrain.  You can then use this as a mask anywhere.

cyphyr

#6
Its not going to be 100% accurate but the ortho render is the way I would go.


  • Place your camera above your area of interest and switch to Ortho and set its field of view.
  • Disable atmosphere.
  • Turn off shadow casting on your sun.
  • Place sun at 90deg (or right above your camera if you've moved significantly away from 0,0,0).
  • Take note of your camera's position (you'll need this info later to place your generated map in the right place).
  • Make your base layer BLACK.
  • Add a WHITE layer surface layer.
  • Switch off Fractal Breakup.
  • (Now the tricky bit :)) Find the lowest and highest parts of your terrain in view.
  • Set the surface layer Limit Minimum Altitude to half of your heighest point.
  • Set your Fuzzy zone to twice your Limit Minimum Altitude.
  • Massage the two above numbers to suite your needs
  • Render

Hope this helps
Richard

<Edit: just saw BB's version, depending on your needs looks a more promissing route>
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

moodflow

You guys are the BEST!  Its always great to put heads together to come up with solutions like this.

Thanks for looking into this. 
http://www.moodflow.com
mood-inspiring images and music

moodflow

#8
There has to be an easier way to pull this off.  I tried BB's method, but it still doesn't seem to pull off what I want, which is a mask that looks just like Cyphyr's posted results (though Cyphyr's method won't work for what I am doing.) 
http://www.moodflow.com
mood-inspiring images and music

bigben

#9
Had another look at my model to see what wasn't performing as expected.   2 things will help in the distribution shader. 
* The altitude range is about 1200m to 300m so reduce the fuzzy zone to 900
* In the tweaks section, reduce the fuzzy zone softness to 0.5. The default is 1 which for this purpose is too high.

For additional tweaking you could add my friend the colour adjust shader after the distribution shader, and don't forget the gamma adjustments which may be useful in this case.