how can i apply acolor shader to only a heightfield qnd not a fractal?

Started by John2k6, February 10, 2007, 07:17:42 PM

Previous topic - Next topic

John2k6

how can i apply acolor shader to only a heightfield qnd not a fractal?

Will

could you be more speisfic please, I don't understand what you are trying to acomplish. are you just trying to change the color of an object or using a color shader to change the shape of terrian for example?

Regards,

Will
The world is round... so you have to use spherical projection.

Cyber-Angel

Will,

I cannot be entirely sure but I think what John is asking is how you go about surfacing a specific height field rather than a procedural terrain! That's how I interpret the meaning of his question at any rate but having said that you are correct in asking for clarification as to the meaning of his question.

Regards to you.

Cyber-Angel

bigben

I'm guessing he wants something like this?.
[attach=#1]

The image I used for the mask is a 2x2pixel white image.

Adding the black distribution shader to the image map may not be necessary, but I had a few crashes without it (not necessarily related) The extra power fractal is just for demonstration. Remove it for total coverage of the TER.

Attached below is a clip file. Adjust the position and size of the image map to match your TER. If your TER is positioned lower left at 0,0,0 then size of terrain = XZ coordinates of the top right corner. Just zoom in on this corner in the preview pane, move the cursor over the corner and read the coordinates below.

(I use TG0.9 to get the dimensions of my TERs and find some good viewpoints)

EBAndrew

I'm trying to use the technique you're outlining Ben, but like in your preview window, everything outside the heightfield comes up with patchy.

I ended up getting rid of the black distribution on the default shader, and the power fractal on the image map. For me, both of them seemed to actually make the patchiness worse. Now, what I've tried to do with my megar (SP?) knowledge of the advanced functions of TG, is take another default shader and attach it to Base Colors as a blending shader, then I put a Constant Color (set to white) as it's opacity.

...but it still comes up as bubkus.

Any ideas what I might be doing wrong?
-Andrew

EBAndrew

While I ended up ditching this idea, I think I might have found what was wrong and I'm gonna throw it out there to see if I was right.

I had nine different surface layers, in addition to Base Colors, and the layer I was applying the transparency to (the Default shader) was the first one after Base Colors. My thinking is that it would affect the transparency of all the surface layers after/connected to it.

There were a couple other weird things that I didn't make sense to me, but I'm going to leave them for now. :P
-Andrew

rcallicotte

Think of the last layer in the node as on the top surface of the planet.  The lowest layer (in the shaders, if you have a long list of shaders) starts with with Base Colours layer and makes the Base Colours lower than any other layer, for example. 

It might help to go to the documentation page and run through Oshyan's tutorial.  It's one of the best I've used.  Most people here who know TG2 very well have at least looked at it.



Quote from: EBAndrew on September 12, 2007, 06:43:07 PM
While I ended up ditching this idea, I think I might have found what was wrong and I'm gonna throw it out there to see if I was right.

I had nine different surface layers, in addition to Base Colors, and the layer I was applying the transparency to (the Default shader) was the first one after Base Colors. My thinking is that it would affect the transparency of all the surface layers after/connected to it.

There were a couple other weird things that I didn't make sense to me, but I'm going to leave them for now. :P
So this is Disney World.  Can we live here?

bigben

Some noob suggested transparency, which is a bad idea  ;)

What he should have told you is to use a more conventional masking technique.

Here's one...

Create two shaders, one for the terrain, and one for not the terrain.
Create your mask and plug it into the fractal breakup of each shader.
Set the coverage for both to 0.5, and fractal breakup to 1
Invert the fractal breakup for the  "NOT terrain" shader
Connect the surfacing for each part into the child layer input of the corresponding masked shader.

Alternatively you could use a merge shader, using the mask as the merge function with your two surfaces as the input.

Here's a sample TGD (minus terrain) using a function mask I created for merging terrains. The TER Metres node is the equivalent of the image width. (may not render with 1.08)

EBAndrew

Quote from: calico on September 12, 2007, 07:17:50 PM
It might help to go to the documentation page and run through Oshyan's tutorial.  It's one of the best I've used.  Most people here who know TG2 very well have at least looked at it.

Yeah, I think I'm going to need to re-read alot of that. My problem is that whatever I don't use within a couple days I generally forget.  :-\

Quote from: bigben on September 12, 2007, 10:12:04 PM
Here's a sample TGD (minus terrain) using a function mask I created for merging terrains. The TER Metres node is the equivalent of the image width. (may not render with 1.08)

Wow, that's an INSANE mask. It has more nodes in it than most of my whole files! Masking is something that, outside of that noob's :P suggestion, I've never really tried before. My workaround hides the fact that there's red stone everywhere, but when I get time I'm going to have to use one of your solutions. Many thanks! :D

...however, I just realized that there's gonna need to be scrub grass on that heightfield, so I guess now is the best time!
-Andrew