blending/masking

Started by NuttyMonk, May 02, 2007, 04:01:08 PM

Previous topic - Next topic

NuttyMonk

I have a hypothetical question regarding shading/masking.

I've done some of the tutorials and think i understand shading ok but i was wondering how you would go about using the shaders on very specific places in a terrain.

Say you had a specific mountain range that you wanted to apply or not apply some terrain modification to.  How would you go about using shaders in this way?  You couldn't use any sort of fractal distribution method.  Could you use bmp pics?  How would you know how big the pic should be and how much area should be coloured white and how much should be coloured black?

I guess this question covers so many different ideas that people might have for terrain and i have a few but i hope you understand what i'm asking.

Cheers

ProjectX

This is a good question, I think your best bet would be to make the mountain a heightfield, I saw a tutorial on generating terrain files from procedurals, have a search for it. Then you'd have to apply whatever effect you're using onto the heightfield only. Again there's a tutorial for that somewhere too.

Sorry I can't point out the tutorials for you, but tbh I've never needed them.

NuttyMonk

I've found that post you mentioned and figured it out.  I'm not very confident using heightfields though so i might not be able to use that as a method for what i was talking about.  I tend to get oddities turning up when i use heightfields, especially if i am trying to use other methods of terrain generation at the same time.  I can't seem to get a heightfield sitting nicely in the middle of a fractal generated landscape and make it look natural.

I'll keep trying though and also try some other methods.

Oshyan

You can load a mask image in an Image Map Shader and use this as the Blend Shader or Fractal Breakup for one or more Surface Layers or other shaders. Use PlanY projection in the Image Map Shader and set the size (in meters) to an appropriate size for the proper coverage in your scene. Then position accordingly.

So for example let's say you have a mountain range that is 5 kilometers long and 2 kilometers wide. You could make a mask image that was 500x200, using white where you wanted coverage of the particular surface, and black where you didn't, then load this in an Image Map Shader, set PlanY projection, set the size to 5000x2000 (remember it's in meters) and then change position until it is properly placed over your mountain range. Finally you would connect the output of this to the Blend Shader input of the Fractal Breakup shader attached to your Surface Layer and enable Blend By Shader in this node. You could connect your Image Map Shader directly to the Fractal Breakup input of the Surface Layer, however the results would probably be too "clean" and artificial looking. Using the Blend Shader input of the Fractal Breakup shader insures a more natural effect since the Fractal Breakup shapes from this node are still used.

If you can get that to work the difficult part is creating the mask image in the first place. We do hope to allow interactive painting in the preview at some point, but for now you'll just have to use trial and error. One possibility would be to position a camera directly over the area you want to create a mask for then render an image and use that render as the basis for painting your mask.

- Oshyan

NuttyMonk

That sounds good.  I'll give that a try tomorrow after this render i'm doing is finished.  It's already been going for 10 hours now and it's only half way through.  I think i've put the quality settings up too high.  :(

NuttyMonk

#5
Hi,

i didn't give that a try yet but i came up with an idea i have been trying recently.  it's similar to the one above.

I have some mountains and i want to apply a shear to the right on some random parts and a shear to the left on the other parts that weren't sheared to the right.

I have set up the terrain and the shears, both left and right and i am using a Power Fractal Shader V3 as the blending shader with the blending inverted on one of the shears.

If you have a look at the attached pic you can see how i have it set up.  Unfortunately it doesn't quite work as i'd hoped.  The left and right shears seem to just cancel each other out as far as i can tell.  I am using large values for the Power Fractal Shader V3 named Shear L + R Distribution.

Feature 500
Lead-in 1000
Smallest 250
Tweak Clumping 1

Can anyone suggest how i should reorganise my node setup to get this to work.  The Shear Distribution L and Shear Distribution R units are Power Fractal Shaders.  Is this right?

I want big clumps of the mountains to be sheared in opposite directions but in a random way, not by using an image map.  It won't look natural but i don't want it to and its as much an attempt to try something different with the node structure than anything else.



I've attached the .tgd file as well in case you want to download it.

cbalaskas

#6
This would be my guess.