Codpiece WIP...

Started by dandelO, July 06, 2008, 08:02:59 PM

Previous topic - Next topic

dandelO

Made with the hobbled free version, TP2.
The fish was free on the internet, I'll find the link and update this...
Thanks for looking!

[attachimg=#]


lightning

this looks awesome mate :o
i love the rays now all it needs is vegetation ;)

zhotfire


dandelO

Cheers, folks!

This was my very fist use of the function nodes in TG2, I've used an inverted Voronoi 3D diff scalar(don't know if this is used in a 'proper' manner but it's suited my need, which, I think, is what they are all for anyway. ;) ) as a caustic light mask. This could be dropped into any scene to lay across the ground, what I really need is the ability to create less opacity in the darker areas of the function so the mask is more see-through and more of the ground beneath will come through. I'll maybe throw a demo .tgd/clipfile in here and see if anyone can fix it to do this, or give some ideas on ways to work it out...
I've already played with this function attatched to the opacity function(various settings) of a default shader but to limited effect.

Thanks!

dandelO

#4
Here's what I'm working with... (Keep in mind that I'm new to functions so, be gentle at my stupidity. ;) )

The first image is the way I done the ground in the fish render above, completely opaque caustic patterns.(Suited my needs in this scene version, but wouldn't hold up for scenes where you need to see the ground texture too).
Second image is the way I want to plan the caustics across the ground, transparent in the middle/bright at the 'high points'. (see shader preview).
Thirdly, this is an example of what happens, whichever way I rack up the 'caustics' to the surface with black areas having reduced opacity, a completely black surface with the caustic light on that, I cannot see the ground beneath.

Any help is appreciated...

j meyer

Hi dandelO,
you could try connecting your caustics set up to the child layer port
of a surface layer then you can control the opacity of the effect via
coverage and break up.

Mr_Lamppost

Nice result and clever use of the Voronoi.

Quote from: dandelO on July 07, 2008, 08:16:22 AM
I've used an inverted Voronoi 3D diff scalar(don't know if this is used in a 'proper' manner but it's suited my need, which, I think, is what they are all for anyway. ;) )

Quite right.  There is no "Proper way" to use functions, they are tools that allow you to create the effects you want. 

At the moment opacity isn't fully implemented, it is either fully transparent or fully opaque.   

Quote from: j meyer on July 07, 2008, 10:38:44 AM
Hi dandelO,
you could try connecting your caustics set up to the child layer port
of a surface layer then you can control the opacity of the effect via
coverage and break up.

You could also try using the caustics set up as the break up function or as the blend function in a merge shader. 
Smoke me a kipper I'll be back for breakfast.

dandelO

#7
j meyer & Mr. Lamppost: Thankyou both for the help. It turns out that the surface layer works a treat but not the way you suggested as a child layer, J. (I'd tried that, and couldn't get the right result, and the merge shader approach too, the white parts were also merged with the first input that way). I've simply replaced the default shader in the caustics group with a surface layer. Plugged the inverted voronoi into the luminosity function(as I only want the voronoi 'casting light') and into it's breakup shader too.
A low coverage(0.1) in the breakup tab coupled with high levels of luminosity(3) creates the effect I was after.

I can't beleive I missed thinking of the coverage level in a surface layer but, to my defence, I did think that the masked areas should have been invisible before reaching it, using the default shaders opacity levels, it certainly appears so in the middle image I posted up there. ^^

If the opacity slider works for an image map with an alpha image, why won't it behave correctly to a black and white function output? Instead, the unspecified areas(Black in an image map) where colour won't be applied, is applied as black anyway. I wasn't looking for transparency, just an opacity mask.

Matt

Hi dandelO,

You won't be able to use the luminosity channel as a function which could modify your opacity. When evaluating shaders as a function (eg. for an opacity function), it is only diffuse colour that matters. If you want to lift the black parts of your function I would suggest that you use Add Scalar to add a constant to your function.

How did you create the light mask, by the way? Do you have a shadow-casting object with an opacity function, or a cloud layer, or what?

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Matt

Quote from: dandelO on July 07, 2008, 08:29:34 PM
If the opacity slider works for an image map with an alpha image, why won't it behave correctly to a black and white function output? Instead, the unspecified areas(Black in an image map) where colour won't be applied, is applied as black anyway. I wasn't looking for transparency, just an opacity mask.

Opacity in Terragen is a little strange at the moment. When ray tracing an object (e.g seeing an object in a reflection, or calculating the shadows cast by the object), opacity works correctly. An opacity image or a function can be used to create a surface which is only partially opaque. However, when rendering those objects directly to the screen, a particular microtriangle can either be 100% opaque or 100% transparent, nothing in between. It's a limitation of the current rendering system. For light masks this won't be a problem, since you're affecting ray-traced shadows which work correctly. And if you apply the function directly onto a surface as colour, or luminosity etc. then of course it won't be a problem because you're not trying to render a semi-opaque surface.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

dandelO

Quote from: Matt on July 08, 2008, 10:04:49 AM

How did you create the light mask, by the way? Do you have a shadow-casting object with an opacity function, or a cloud layer, or what?

Matt


Ha, I wondered who'd be the first to ask that, it doesn't surprise me it's you, Matt! :D
The light ray's mask is, indeed, just a cloud layer with 'primary' disabled, there's not a ray-traced atmosphere, I do this a lot. Another recent image here with this is 'Pierced' http://forums.planetside.co.uk/index.php?topic=4267.0 Those visible clouds don't cast the rays at all, it's another invisible layer making the rays.
The ripple making it appear like there's a water-line overhead is obviously just an image map in the background node.

Thanks for the advice on the functions too, I'll continue playing around with it. I just wanted to use the voronoi function output as the luminosity function mask in a terrain surface, so the fake caustics could be applied after the last shader and still retain it's opacity, I simply had one shader too many, the default shader was unnecesary as I didn't really need to apply the opacity, the surface layer coverage/luminosity levels do it 'correctly' anyway if you balance them low/high, respectively. Another quick and decent workaround. :)