What is the HeightField Shader tab for?

Started by jritchie777, October 11, 2009, 07:18:28 PM

Previous topic - Next topic

jritchie777

I'm still a bit confused on this shader function for the HeightField generator, it seems anything I put there does not work...

I've attached a .jpg of the shader tab I'm talking about.

dandelO

If you plug in, say, a default power fractal terrain in here, clicking 'generate now' will generate the portion of that fractal terrain, at 10,000m2(size in metres value), according to the heightfield shader coordinates. You're best leaving these coordinates at '0' and using a transform shader to move the fractal shader around instead of the heightfield shader, I'd imagine. Or just click random seed on the fractal and edit its parameters 'til you get the desired results.


jritchie777

I should have been more specific, I'm not really having a problem with power fractal or coordinates, the specific question is what shaders can go into the shader field and actually do something?  I've tried color shaders, displacement shaders, none seem to work.  So what is the shader field for?

Thanks to some advice from an earlier question I know I can manipulate the Node network with some shaders, but the result is the same as if you went to global shader tab and created shaders there then the whole terrain is effected by it.  Only problem with that is that in nature you don't have all the terrain the same.  When I started on this experimentation path I was trying to get two different heightfields to have different shaders so that you can different results on each heightfield.  I have yet to find a way to do this...

Hopefully that is clear what I'm trying to do now if it makes sense.
Thanks,
JR

Oshyan

Any shader that provides *displacement* can be used. Or rather, *only* shaders that provide displacement can be used. So, mainly, this would be the ones that show up in the Create Shader menu under Displacement Shaders. Note that some, for example the Image Map Shader, do not inherently provide displacement by default, they must be set up to do so.

In the case of the Image Map Shader you have to check Apply Displacement on the Displacement tab and adjust the Amplitude appropriately. Remember the size is also measured in meters and for the Image Map Shader it is only 1 meter by default, so this should also be adjusted.

More generally, the shader input is essentially designed to allow you to convert any *existing* displacement into a heightfield for export or further processing. There is not much reason to do this unless you need to either perform heightfield-only operations (e.g. erosion), or you want to export. For a scene entirely in TG2, not using heightfield-specific effects, it is best to stay with procedurals for maximum detail.

An example of use: Put a Power Fractal terrain into your scene and make sure you can see it creating terrain. Now, let's say you want to do some erosion on a section of that terrain. Erosion can't be performed on procedurals for technical reasons (this is not a TG2 limitation, procedural erosion is a generally unsolved problem), so you need to convert it to a heightfield. Heightfields are finite, a limited area of terrain (as opposed to the "infinite" area of a procedural terrain), so you need to decide on the specific area you want to work on. This will be entered in to the size and position parameters of the Heightfield Generate.

Once you've selected the area to operate on, plus the Power Fractal into the Shader input of your Heightfield Generate. Then press the Generate button. Once completed, *disable the Power Fractal*. You should then see a stand-alone square section of your terrain, just where you specified in the Heightfield Generate size/position controls. Now you have a heightfield version of your procedural terrain. You can perform erosion by using Add Operator in the Terrain layout node list area, or you can export to TER or EXR format by right-clicking the Heightfield Generate.

I hope that helps.

- Oshyan

jritchie777

Thanks, good explanation - I will try it later to see if I understand it. :)
JR

p.s.  My offer from previous post still stands, any help in finalizing documentation I would be glad to help.