Me again - adding a road

Started by FrankThomas, December 22, 2006, 09:18:06 AM

Previous topic - Next topic

FrankThomas

Right.

I'm thinking I can maybe use a density shader to mimic the appearance of a road.  If I make a surface shader and cover it in grass, then plug in a density shader to the same grass shader but feed the density shader with a greyscale image of a track or something like that, will the grass avoid the white bits of the density shader and only cover the grey? 

Assuming this is the case, how do I get the image into the density shader ? how big and what format would I need to make the image ?

(you guys are going to get so fed up with me asking questions after a while :) )

old_blaggard

I think what you're trying to do would work, but you explanation is a bit hazy and my brain is a bit foggy right now (early in the morning), so I'm not 100% sure right now ;D.  For getting the image map into your density shader, it's actually really easy: use an image map shader ;).
http://www.terragen.org - A great Terragen resource with models, contests, galleries, and forums.

Oshyan

Use an Image Map Shader, plug it in to the Breakup Shader input of a Surface Layer (or the Blend Shader input of any other node type that you want to "mask"). Create your image in grayscale as a normal mask in an image editor. The higher the resolution the sharper your road can be and the smaller the features you can define. Once you have finished it load it into your Image Map Shader and then set the size appropriately. It's measured in meters and it starts out only 1x1 meter, so you'll want to increase that quite a bit most likely. Adjust to taste. That should give you the basics which you can work from to get best results.

- Oshyan

EmDee1

Hi there,
I'm trying to build a road the way Oshyan explaint, but I can't get it to work properly.
I want the road to go in a Heightfield area.
This is what I do:
1. Heightfield generate
2. Shaders menu: change Base colour: green and black
3. Ad layer: Surface layer (coverage set to 0.5)
4. In the Surface layer select Fractal breakup:
    Blend by Shader
    ...
    Create new shader
    Color shader (or surface shader): choose Image map shader
5. Select a mask image (prepared in Photoshop)
So I end up with a road, that's ok of course, but the road isn't "attached" to the heightfield.
When I change the camera position, I can see that the masked road is at world level and no longer in the Heightfield area.
How can I attach the road to the Heightfield? Can't find out what I'm doing wrong.
Someone can help?

             

Oshyan

Apparently I neglected to tell you to set "PlanY" projection. See if that helps (assuming your size is also set correctly).

- Oshyan

EmDee1

Yes! PlanY-Projection, that works. Just one simple mouse-click!
Thanks so much,
EmDee1 (Mario Dijsselbloem)