Author Topic: Codpiece WIP...  (Read 6635 times)

dandelO

  • Guest
Codpiece WIP...
« on: July 07, 2008, 12:02:59 AM »
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!

11659-0


lightning

  • Guest
Re: Codpiece WIP...
« Reply #1 on: July 07, 2008, 12:27:50 AM »
this looks awesome mate :o
i love the rays now all it needs is vegetation ;)

Offline zhotfire

  • Member
  • *
  • Posts: 67
Re: Codpiece WIP...
« Reply #2 on: July 07, 2008, 06:44:03 AM »
Kelp! Kelp! ;)

dandelO

  • Guest
Re: Codpiece WIP...
« Reply #3 on: July 07, 2008, 12:16:22 PM »
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

  • Guest
Re: Codpiece WIP...
« Reply #4 on: July 07, 2008, 01:35:45 PM »
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...
« Last Edit: July 07, 2008, 01:39:29 PM by dandelO »

Offline j meyer

  • Member
  • *
  • Posts: 2159
    • orkwarts
Re: Codpiece WIP...
« Reply #5 on: July 07, 2008, 02:38:44 PM »
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.

Offline Mr_Lamppost

  • Member
  • *
  • Posts: 1062
Re: Codpiece WIP...
« Reply #6 on: July 07, 2008, 11:35:14 PM »
Nice result and clever use of the Voronoi.

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.   

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

  • Guest
Re: Codpiece WIP...
« Reply #7 on: July 08, 2008, 12:29:34 AM »
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.
« Last Edit: July 08, 2008, 12:32:32 AM by dandelO »

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3578
  • I'm the crazy one
Re: Codpiece WIP...
« Reply #8 on: July 08, 2008, 02:04:49 PM »
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.

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3578
  • I'm the crazy one
Re: Codpiece WIP...
« Reply #9 on: July 08, 2008, 02:11:01 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

  • Guest
Re: Codpiece WIP...
« Reply #10 on: July 08, 2008, 06:30:15 PM »

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. :)