Help with a rather modest project.

Started by PabloMack, February 18, 2013, 12:55:19 PM

Previous topic - Next topic

PabloMack

Just for the learning purposes, I am trying to do a seemingly simple project to see how it might be done. I have created a new project with the following steps:

1) Delete the Heightfield and shader. (I don't need them)
2) Create a Fractal Terrain and give it more colorful high and low colours. My seed is 36593
3) Add Altocumulus layer to make the sky more interesting (leave at defaults)
4) Create an Image Map Shader and spherically map a 8192 X 4096 image onto it.

Next I want to somehow use this color value to scale the Fractal Terrain's magnitude. I want black to multiply the scale of the terrain by 0 and white to multiply the scale of the terrain by 1. This will make flat plains where the image is black, low mountains where the image is gray and high mountains where the image is white. Next I want to raise the base of this mountain layer with a altitude map using another image map. I already understand how this is done. I just need to know how to use the output of the mountain scaler image map to scale the terrain.

So far, I have tried to use the output of the image map shader in both of the Terrain Node's inputs. Nothing I have done seems to make it do what I have in mind. Just to test the image map shader, I have an image that is all white and another image that is all black. The all black image should scale the terrain to zero and nullify its effect on the surface of the planet. Any help would be appreciated.

cyphyr

#1
Without seeing your tgd it's something of a guess. Your method should work. Check your spherical map centred about the planet centre (default is: 0, -6.378e+006, 0 )
Remember your mountain fractal displaces down as well as up so you need to offset it by half its displacement.
Richard

The file attached shows the method. Just add in your own spherical map. I've exaggerated the terrain displacement values so it's obvious but you can clearly see how mountainous areas are displaced more than the planes.
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

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

PabloMack

#2
I am not using a Heightfield. In fact I have deleted the Heightfield Shader and the Height Field Generator to make sure they have no influence on the image. I am trying to vertically scale a global Fractal Terrain by a factor using an image map shader that is spherically mapped with an image. In the diagram the image map shader is relabelled as "Global Terrain Scaler". I have loaded a map into this that is totally black. Because black should generate 0, then the factor multiplied by the global terrain should force it to 0 and the land should be flat around the whole planet. But it is not. It has no effect on the Fractal Terrain. I have avoided using the Heightfield nodes because (I think) they are limited to influencing the effect in the absolute +Y direction instead of a radial direction emanating from the center of the planet. I want this effect to be global, not local.

Update: I duplicated what you did in the node editor. I loaded the image map shader with an image that is totally black and selected Spherical projection type. I have loaded a picture of the image map shader's settings below. The planet is still not flat.

cyphyr

You're plugging your " Global Terrain Shader" into the wrong slot. Try it as a blend shader.
In the sample above I could have deleted the top two nodes, they are not doing anything.
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

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

PabloMack

I've tried plugging the output of the "Global Terrain Scaler" into each of the two inputs of the "Fractal terrain" node as well as both inputs simultaneously. No visible difference.

cyphyr

Check your spherical map centred about the planet centre (default is: 0, -6.378e+006, 0 ), yours is centred about 0,0,0.
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

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

PabloMack


cyphyr

Hmm odd, can you upload the tgd and the image you're using as a spherical projection map (at a suitably small res).
This method should be working (unless I'm misunderstanding what your after).
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

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

PabloMack

Here they are....

mhaze

You need to tick the blend by shader box

PabloMack

#10
Voila! Mapping in a gray scaler image I get rolling hills!

Thank ya'll for your help.  :)

Next I would like to make sure that the Global Terrain Scaler's output interpolates smoothly between the scaling image's pixels. Looking in the Displacement Tab of the image map shader parameter window, I see that the Apply displacement box is not checked. Should I check it?

Tangled-Universe

Why don't you try it yourself!? ;)

All I can say, without spoonfeeding you, is that the image map shader can indeed apply the displacement for you so that you don't have to connect the image map shader into a displacing shader.

PabloMack

#12
Thank you cyphyr and hmaze for your friendly help.

Quote from: Tangled-Universe on February 19, 2013, 03:23:56 AM
...don't have to connect the image map shader into a displacing shader.

I tried that too.

Tangled-Universe

#13
Quote from: PabloMack on February 19, 2013, 09:56:33 AM
I tried that too.

What is your question? It's not really clear to me what you're trying to achieve or what the problem is you're encountering or both.
The interpolation options are in the image map shader themselves and so is the possibility to have the image map shader apply displacement according to the luminance values of your imported image.

I don't mean to be unfriendly, but as long as its not clear then it's hard to help and questions in the line of "should I or should I not enable that tickbox" are a bit of a waste of time for everyone because you can simply try and see for yourself :)

So again, what would you like to do and what is the problem you can't fix?

Cheers,
Martin

PabloMack

Quote from: Tangled-Universe on February 19, 2013, 10:24:03 AMWhat is your question?...

After my original problem was solved I wanted verification on a question which I will now reword as a proper question: "How do I know that my Global Terrain Scaler's output is interpolated smoothly between the scaling image's pixels?"Ignore the rest of what I wrote in my last post as it just confuses the issue.  Recall that my "Global Terrain Scaler" was implemented using an Image Map Shader.

What I did was to first spend a few minutes rendering with and without the box checked. I couldn't tell a difference. So I unchecked it and I made two special maps with high contrast (black and white). The first map is a checker board and the second map is all black in the southern hemisphere and all white in the northern hemisphere. I probably spent an hour navigating the perspective camera around looking at the surface of the planet trying to see if the edges where the scaler map went from 0 to 1 because of the sudden high contrast of the maps. I decided that the checker board was pretty useless so I concentrated on the map that was upper-white and lower-black. My findings were inconclusive. I didn't find a sharp drop off at the equator where the scaler map suddenly when from 1 to zero. You can't even see the scaler map directly anyway so it is like groping in the dark.

I decided that the image was unaffected by the little check box because that section of the shader's menu panel was not being used for the way I had its node plugged in to the node network and had little understanding for how it worked.

I also did a lot of other stuff that I will not elaborate on here. So, in conclusion, the effects of something as simple sounding as turning a switch on or off is not necessarily as simplistic as seeing that a light is on or off. And the effects of making a change can be so subtle as to be very difficult to even detect. The turn around time to randomly try this and that can be quite time consuming so it is often much faster to just ask an expert how a control in a menu is "supposed" to work. By randomizing controls with add hock exploration I have found that I can totally screw up my settings and never be able to figure out how I destroyed my project and just have to start over from scratch.