Fake stones shader

Started by helentr, January 07, 2007, 11:10:56 AM

Previous topic - Next topic

helentr

Hello,

I tried working with the fake stones shader, but I have run into problems, probably out of ignorance.
I tried restricting the stones' distribution, according to an image map, but was unable to do it, in fact linking the fake stones shader to a surface layer made from an image map, crashed Terragen. I looked at the shaders' nodes and it seems that each surface is linked to the previous, not as I would expect to the base colors (when I tried to change this manually, all the shaders disappeared). So, linking the fake stones shader to any surface layer seems to make a loop.
I abandoned that and tried to give a texture to the stones, linking it to a power fractal and I ended up with these huge stones:

So, please, any directions, advice etc would be welcome.

Helen

MeltingIce

Hmm I touched on doing this in my fake stones shader tutorial, its step 3 so you can jump right to it: http://www.designpaths.com/terragen-tutorials/using-the-fake-stones-shader/

Let me know if that helps

MeltingIce Network | Wii Number: 3881 9574 8304 0277

helentr

Quote from: MeltingIce on January 07, 2007, 01:33:51 PM
Hmm I touched on doing this in my fake stones shader tutorial, its step 3 so you can jump right to it: http://www.designpaths.com/terragen-tutorials/using-the-fake-stones-shader/

Let me know if that helps

Yes, thank you, that has helped in getting me started, but I don't want the stones distributed over a random shader, I want them to go on an image map. I thought of making the fake stone shader  a child layer of the image map layer, but the first doesn't have inputs for this. Trying to connect it in any way to any of the other surface layers seems to create a loop and puff! goes Terragen.
A distribution shader can't take an image map, but a default one can (at least take an image). The problem with this is I can't see any stones (also lost the huge stones). There is no way to place (starting point, dimensions etc) an image  on a default shader, only on a surface layer, but that causes loops.

Helen

Oshyan

Use an Image Map shader with appropriate settings (PlanY projection and a proper size in meters) and plug it in to the Blend Shader input of your Fake Stones shader. You can also connect your Fake Stones shader to the Child Layers input of a Surface Layer to restrict it to the same distribution as that surface layer. You can then use height and slope constraints on it, as well as using an Image Map as the Breakup Shader input for an explicit mask.

- Oshyan

helentr

Quote from: JavaJones on January 07, 2007, 07:16:29 PM
Use an Image Map shader with appropriate settings (PlanY projection and a proper size in meters) and plug it in to the Blend Shader input of your Fake Stones shader. You can also connect your Fake Stones shader to the Child Layers input of a Surface Layer to restrict it to the same distribution as that surface layer. You can then use height and slope constraints on it, as well as using an Image Map as the Breakup Shader input for an explicit mask.

- Oshyan

Thank you, Oshyan,
None of the solutions seems to work. I have colored the stones pink and they are not there. It seems that the image map shader only works on a fractal breakup input, not on a blending input.
And connecting the fake stones shader output to the child layer input of a surface layer, whether or not it is still connected to the next surface layer and even if I make the stones size 10, there are no stones. Even doing both, has the same result. The layer based on the image map is visible.
Maybe it is not possible?

Helen

Oshyan

Your example files seem to work fine here with my own images, but I don't have your original terrain or the images you're working with so it's hard to make a firm diagnoses.

I recommend you try starting simpler, with a default scene, and see if you can get an Image Map shader working through a blend shader input to properly constrain your Fake Stones. Same with the child layer input of a Surface Layer. If you are going to work with a heightfield, try using one of the built-in heightfield generators so that in case you have to share the .tgd again for example, you won't need to include a large .ter. You can use .jpg versions of your masks to keep size down and zip them all up with the .tgd if you do need to provide another example of a problem scene.

- Oshyan

helentr

#6
Quote from: JavaJones on January 10, 2007, 01:49:31 AM
Your example files seem to work fine here with my own images, but I don't have your original terrain or the images you're working with so it's hard to make a firm diagnoses.

I recommend you try starting simpler, with a default scene, and see if you can get an Image Map shader working through a blend shader input to properly constrain your Fake Stones. Same with the child layer input of a Surface Layer. If you are going to work with a heightfield, try using one of the built-in heightfield generators so that in case you have to share the .tgd again for example, you won't need to include a large .ter. You can use .jpg versions of your masks to keep size down and zip them all up with the .tgd if you do need to provide another example of a problem scene.

- Oshyan

Thank you Oshyan for trying.
I have tried simpler: loaded the same terrain and 2 masks, colored one red and the other blue. So far they load fine and show the colors. Then put the fake stones shader as a child to the blue layer - it works. Then I try to add a tree population and control its distribution by the red layer (the action that crashes Terragen). To prevent it crashing I add the image used for the mask separately (use density shader->image map shader->load the same image). When I press calculate for the population, Terragen crashes. When I reopen the tgd it is a mess. The image map shader is in the left pane in the object tab, but does not exist in the node view (I searched) - it is written inside the tgd file as the last item. The heightfield does not appear, because of some wrong connections, I suppose (I might have been guilty for this, inadvertently).
I have tried numerous times and it seems that whichever distribution I choose first (fake stones or trees) works; the second causes problems.
I open, change a small thing, save under another name, next action crashes Terragen, then reopen the scene and the same thing goes on.It is maddening. Sometimes the tree distribution is not affected by the image map and I have to close and open Terragen and try again.

So, it seems that it is not a specific problem with the fake stone shader, but with the distribution of objects and textures on surface layers and the instability this seems to cause. Hopefully this will be cured by some future patch or a new computer for me (1 Gb of memory seems too little) - the patch should come first, the way things are going.

Anyway, this has made me more comfortable with working with the node view  :)

Once, I was lucky and got an image with both distributions, but have had no time to refine it. It is attached with the TGD and TMD (Worldmachine) file. I was unable to reverse the distribution of the stones and trees, because of crashes.

Helen

You might consider adding TMD files to the allowed file types.

Oshyan

I haven't heard any specific reports of problems like yours. Hopefully we can diagnose this further as I'm sure we can fix it in a future update if we nail down the cause.

The difficult part of this is that there are other crash issues potentially involved, particularly with objects. Can you test whether multiple Fake Stones layers can use Image Map blend shaders? If not then it may be related to objects in particular, which wouldn't be surprising.

Also are you using images straight out of World Machine and have you tried multiple image formats, or just one? You might try loading the images that WM saves into an image editor and re-saving as another format such as .jpg or .tif. I've found some potential instability in dealing with certain image formats.

- Oshyan