Planetside Software Forums

General => Terragen Discussion => Topic started by: Dune on August 18, 2010, 07:29:56 AM

Title: specular stuff
Post by: Dune on August 18, 2010, 07:29:56 AM
Regarding specularity in objects (leaves in particular), I did some quick tests. Here are the results, and as you see there are many possibilities to alter leaves and such. I'm sure there's more to cook up.
The point (for me) in altering the leaves (or other object parts) is that the maximum size in PF is set at 1, the smallest at 0.01 and the first at something like 0.1.
Title: Re: specular stuff
Post by: domdib on August 18, 2010, 07:43:20 AM
Thanks for sharing this - I'm sure it will be very useful to forum denizens.
Title: Re: specular stuff
Post by: Henry Blewer on August 18, 2010, 08:15:32 AM
I actually lurk here.

Nice testing Ulco. This technique would be useful for many objects.
Title: Re: specular stuff
Post by: Tangled-Universe on August 18, 2010, 08:36:36 AM
That's looking good Ulco.
I especially like the idea that you also used the specular function as blendshader for the surfacelayer which adds color (I presume).
Could you render that again for me and a bit bigger please?

Martin
Title: Re: specular stuff
Post by: Dune on August 18, 2010, 11:05:03 AM
Yes indeed, I figured that if you want to keep all specularity, the parts where that occurs should be canceled out of the (autumn) color you put over it. Although autumn leaves may be less shiny when rotting away, but on the other hand, when raining they should keep it. This was a very simple setup, but you can elaborate with adding colors/luminosity through the color input of the surface layer. Or even through an image map projected by a camera over the pop, as I posted earlier.
I think this way you can even get certain parts of a forest loose their leaves, or have them disintegrate like in an autumn setup. Haven't tested that yet.

I'll render it bigger, I think I kept the tgd....
Title: Re: specular stuff
Post by: Tangled-Universe on August 19, 2010, 02:02:06 AM
Thanks Ulco, looking forward to see it bigger.

I also played with the opacity function in my latest image. Trying to get rid of the regularity of all the leaves by cutting pieces away with a fractal. It's extremely difficult to get the right scales. Also, you end up with leaves which aren't attached to the branch anymore, because that part was erased by the opacity function.
While typing this it occured to me that I could try to subtract the fractal color from the leaf-map. That leaf-map is masked (inverted) with a slightly smaller version of the original leaf-map to make sure only the edges are affected for example.

That would mean that the leaf-map needs to be loaded in an imagemap-shader and then plugged into the defaultshader of the object. Wonder if that works. Need to check that out.
Title: Re: specular stuff
Post by: Dune on August 19, 2010, 02:23:41 AM
If you use the opacity function to break down leaves, you'll probably end up with pieces of leaf flying around without stem, good chance anyway. But from a reasonable distance it won't be very visible and you can still make 'autumn degrading' trees, where for instance the tops are virtually leafless. But, mind you, I took just any tree to test this, and this happened to be one with plain, flat squares 'attached' to the final branches, and they kind of angle in any direction, so the leaves aren't attached to the stems at all. It is a low poly distance tree.

I was thinking ahead (I tested this before on grass stems) and thought that it is also possible to get tiny droplets of water on the leaves if you take a really small scale billow PF, big contrast, and give it some displacement. The way I did the ivy on the wall in Garden of Eternity. Then attach a water shader (or reflective shader), perhaps blended by a default shader where the opacity function is ruled by the same small scale fractals, to reduce the amount of 'water' to be rendered. I might try this all on a real leaf...

I don't quite understand why you'd want only the edges to be affected... but indeed working with another, smaller leaf mask will produce any affect only within that masked area, so you can leave the tiny stems alone. You can even paint exactly where you'd want anything on that leaf to happen. Don't you use an alpha channel as mask?

This is a little bigger; you'll see the green plain leaf cluster (totally flat), with a color pf into the color function + a shader attached to the specular function input.
Title: Re: specular stuff
Post by: Dune on August 19, 2010, 09:34:56 AM
I managed to squeeze out some drops of water on the leaves the way I described in the previous post. Took some tuning. I'll leave this now, but everyone can see there are certainly possibilities. Even breaking the leaves up for 'autumn rot' works fine, but I kept it out in this render, or it would become a mess.

---Dune
Title: Re: specular stuff
Post by: Henry Blewer on August 19, 2010, 10:22:08 AM
Neat.
Title: Re: specular stuff
Post by: Dune on August 20, 2010, 07:49:31 AM
One more, a bit bigger. Testing grasses now with the same settings, but at detail 0.7 and AA6 it takes ages, so I cut him short. Might be better to use the reflective shader instead...
Title: Re: specular stuff
Post by: Dune on August 22, 2010, 03:14:32 AM
A last try, for the time being: trying to get dewdrops onto grass leaves. It works, but takes such an awful long time to render, that I'll abandon this. Perhaps if I work this out with a distance shader and reflective shader settings, it'll be faster. Attached a water shader, blended by a tiny white spots PF, the same PF also displacing the leaf slightly.
Title: Re: specular stuff
Post by: Henry Blewer on August 22, 2010, 08:24:22 AM
I think there would be a lot of flickering from the water drops if this were animated. But it is cool. Perhaps the drops are a little large?
Title: Re: specular stuff
Post by: Walli on August 22, 2010, 04:50:55 PM
you could mix a bitmap gradient or procedural gradient with a procedural noise/fractal. The bitmap gradient assures that the base (stalk) of the leaf stays visible in any case.

Another option which can help a lot is to make use of procedural displacements.

AFAIK the problem right now is that raytracing objects and displacement does not work yet and also its a bit cumbersome to mix UV based bitmaps with 3 dimensional procedurals.
Title: Re: specular stuff
Post by: Dune on August 23, 2010, 03:26:54 AM
Thanks for chiming in, Walli. Wouldn't it be easier to have another (very small) mask of the same leaf, where only the areas you'd want drops are white? The 'problem' of course is that for every leaf the drops are the same, but this can be overcome again by blending it with a camera controlled image map, where some areas of the population have more, others less density. Perhaps even two of them, so you can vary on a small and larger scale.

Your second option I already used in this; I displaced (into the default) just a little, using tiny fractal spots. That works fine, although I agree with the word 'cumbersome'. I also tried tiny fake stones in this 'bump mapping', but that wasn't much better. It is not really displacement, but the bumps are there anyway. These tiny bumps reflect (water shader or reflective shader) light, but some reflections end up too large.

With a little more experimentation I think it's quite feasible to get vegetation wet and shiny with dewdrops.   

Title: Re: specular stuff
Post by: Walli on August 23, 2010, 05:33:02 AM
well, I know thats no fair comparison, but in Cinema4D (or similar tools) you simply:
-use a bitmap mask to define the areas of the leaf, which are allowed to be effected by droplets/displacements/what ever
-mix in a procedural noise
-done

I have to check this in TG2, because it´s a while since I last tried. But at that time mixing a bitmap/procedural that depends on UV with a "free" and three dimensional noise didn´t work very well (or at all?)
Title: Re: specular stuff
Post by: Tangled-Universe on August 23, 2010, 06:59:44 AM
I don't if this works?:

Load an alpha-image into an image-map shader, set mode to UV, and use that as a blendshader for your dropletfunction?