TLHPro - WIP Thread


#1

You all may or may not know the free collection of “Tommys little Helpers” (TLH for short) shader nodes that I did as a first exercise when the messiah SDK came out. They are available for free from my website: ScreenDream - Tools for all messiah:studio users.

After “The Art of Noise” was finished, I started improving this old collection and soon found myself with so many new ideas that I decided to not only update them but make them into a whole new package that is vastly improved and contains lots of new shaders too.

So in this thread, I want to show you some WIP renderings that I do to test this stuff and you are invited to give me some feedback and feature requests for tools you miss in the shaderflow.

OK, enough words:

All object in this image use the TLHPro:Distance shader in combination with a gradient.
The spiral and the cube have spherical distance from themselves active, the floor uses spherical distance to the camera, the sphere uses the Y distance to the camera in world coordinates and the spherical object to the right uses Y distance to a Null object in local coordinates.

The distance can be measured in world, local or “goal” coordinates (that is in the coordinate system of the object that is used to measure the distance.
Optional you can clamp, step or smoothstep the distance with animatable min and max settings. Also you can offset and scale the distance value (cool for connecting a noise or turbulence to disturb the gradient).

The image is rendered with AA Level 2, Monte Carlo/Environment, 3 GI samples, GI Depth 2 and GI Noise Reduction. The latter was giving me weird results as long as I followed the docs. After some experimentation, I used 1,000,000 Photons, a Tolerance of 5, a GI Gather Radius of 0.25 and a GI Gather Count of 1000. Values above 1 for the Tolerance have given me the best results so far, even up to 10 or more…
The rendertime was 1:54 Minutes on a P4 with 3.2 Ghz.
The spiral thing has light emission active.

Cheers :bowdown:


#2

look really good …

altough i am not deep enough in messiah renderer to apreciate the technical aspect :smiley:


#3

very kool tool, Thomas


#4

Thanks guys :slight_smile:

The next two tools will hopefully be a bit more exciting - TLHPro:Thickness and TLHPro:RayType - Both are almost finished now.

Stay tuned :wavey:


#5

Very nice examples, Thomas! Looking forward to working with Santa’s … err… uh… I mean Thomas’ Little Helpers. :wink:


#6

hehehe - and don’t forget mothers little helpers… (I like that song a lot) :wink:

Anyway, here comes the next example:

Basically the same scene, but now the thickness of the objects is used as input for the gradients. The most straightforward is the cube that looks almost as if it is a bit transparent - but it isn’t, just the thickness varies and therefore the color. This is the classical thickness along the view ray, just straight ahead. But even here you have a lot of control over the final look since there is an advanced section in my shaders to scale, offset, min/max, smooth, bias and gain your thickness values.
The spherical thing to the right uses something I invented (at least I haven’t seen it before :slight_smile: but it can’t be new - it is just too obvious) : Thickness along the inverted surface normal. Sounds complicated but is quite simple. The view ray hits a point of the surface and I measure the thickness along the normal of the surface at that point. But since the normal points outwards, I invert it to look inside :slight_smile:
This is no longer dependent on the direction from where you look and stays stable when you animate the object (unless you deform it). The second good thing about it is, that it often gives a better impression of what you would call the thickness of an object in real life. Think of a sheet of paper: Normal view-based thickness would give you a lot of thickness if you look in a flat angle on the sheet, but my normal-based thickness keeps it always “thin”.
The two spirals show the difference again: the one on the right uses view direction which is interesting but also a bit weird and “technical”. The one to the left uses normal direction instead and gives a more natural feeling of “thickness”, only at the endpoint it is a bit weird (since my polygons aren’t smooth enough here).
You may also notice that on the thin edge there is a red (= thick) outline since at that point the normal direction looks through the whole object.
So none of the options is completely perfect, but they should give you a lot of options to play with.

At last, the sphere on the left uses a special mode: If you ever tried to use thickness or incidence driven gradients on spheres, you may have noticed that their thickness/angle rises very fast at the edge while over the main area there is little change, so your gradient needs to be very stretched to make it look linear. To make that easier I invented a “normalized” view direction thickness that makes such a gradient much more linear on things like spheres. In this example the yellow-to-red color gradient isn’t stretched at all. Cool for spheres as particles or planet-atmospheres :slight_smile:

If time and brain allows, I have also an idea for a kind of “smooth thickness” that sends multiple rays into the object and takes the average to overcome the hard jumps often seen with such thickness stuff… But that is another can of worms…

OK, so far for today

Cheers! :bowdown:


#7

So far you are very close to the title “ShaderGod” man. :thumbsup:
I think this cries for another call to Berlin. :twisted:


#8

Looks great, man! :thumbsup:

Though looking at those spiral things for too long has a psychedelic effect on me :eek: …


#9

The effect on the cube looks cool, a nice smooth transparent depth :cool:
You must show it animated!!! And try to make some grapes or something!

If it’s a usefull feature, which I think it is! It should be deformable, so I suggest you to recalculate the normals every new time! :wip: :thumbsup:

/ Svante


#10

Hey Thomas!! thats really great stuff :smiley:

Specially the new thickness shader, that will be very very usefull...

I can see how it could be used to help fake SSS… and extremelly usefull for controlling the other SSS shaders too, i.e. if for example you want to increase SSS brightness on thinner bits realative to the larger features… this isnt normally possible in messiahs shader (or any other volumetric translucency shader)…

But, Ha ha,  in fact, it was I who  invented this trick! :)

Heres the steps for doing it in LW:
UV map the object in a baking friendly manner
Make object 100% Luminous white and apply a Black thickness gradient on it
Bake… (will only work with Microwave plugin because LW’s own baker cant bake raytracing)… This will come out with the same results (I think) as Thomas shader, since the baking always occurs in normal direction and thus (luckily) calculates the thickness ray in normal direction too!!

For a softer more realistic quality:
Make the objcet double sided (as in double polygons facing oposite directions... like the glass trick)
The inner surface Luminous %100 white
Outer surface pure black
Apply thickness gradient to transparency of Outer surface
(btw, Inner surface is normals pointing In, Outer is normals pointing Out)

This will look the same as the first example, but...

If you put a bit of refraction, and turn up transparency blur way high, it will come out with that scatered soft look… looks really nice :slight_smile:

well… I cant wait for these shader to come out and save me all that work!!! Thanks Thomas for your efforts in making Messiah better.

have you thought about making a thickness shader that uses the light direction/position?
I always wondered if we can raycast thickness from camera pov why not do it from Light pov…

Thanks

SergO


#11

duplicate message


#12

AlexK: Don’t give me that “god” thing please. I’m quite content with being that 39 year old german bloke I am…
I’m completely self educated so everybody can do it - no godlike powers involved :wink:

OK, this may have been unclear (sorry, if my english sometimes is a bit weird): The normal is not only calculated for every frame but for every single rendered point of the surface - that is no problem. What I meant to say is: If you only rotate and translate the object, the normal dependent thickness will stay completely unchanged and calm. If you deform the object, the parts may become thinner or thicker, therefore the thickness will change. I made it sound more complicated as it actually is, sorry :slight_smile:

SergO:
This is one cool trick with the baking! I always loved using things in a way they weren’t intended to in the first place :slight_smile:
So I just invented it for myself - “local brain coordinates” so to say - not too bad either :bounce:

Yeah, exactly that kind of thing is what I was thinking about with my “soft thickness” - I just have to test if the speed is halfways decent - most of the time such stuff is too slow in practice IMO. It is a pain that with point based surface rendering you always have to send out so many rays to get soft results…

Ha - your suggestion is already in there but in an early stage so I didn’t show it: Thickness from Object. In fact you can use any object to measure the thickness from. :thumbsup:

And something I forgot to mention in the image above: all objects have “double sided” turned on. If they don’t, the shader will deliver the “thickness” towards the first object behind the currently rendered object. Should be nice for some effects too (People walking around behind a wall etc.).

There is way more in the pipe so stay tuned!

Cheers and thanks for all the nice comments! :bowdown:


#13

btw, re the technique above, the thickness gradient should be set so that the gradient is as big as the entire object, and save the resulting baked image in a floating point format, this way you can load it into Messiah and use a gradient to control it in whatever way without losing quality.

Feature request time :smiley:
Thomas, Is is possible to have a shader that reads weighmaps… I really miss using weighmaps as input gradients… usefull for so many things besides boning :frowning:

Like for example, if you want to blend seams in two UVed textures, I would make the UVs so that they overlap by one poly along the seam edge, then use weightmaps to blend it across… I often use them to apply makeup of characters or quick Spec maps… Like this LW render here: http://www.3dtotal.com/home2/gallery/images/big/1206.jpg

Effectors are unfortunately too simplistic to be usefull in the majority of cases…

Cheers

Serg

#14

Hey sounds really cool about the use any object to calc thickness from! do you have a test render? :slight_smile:

I’m so happy you did the thickness shader :slight_smile: it’s something I was really missing… Its great for alot of stuff …

SergO


#15

SergO: Wow - that face is beautiful! :bowdown:

I know exactly what you mean and I never understood the reason behind pmG not using the power of weight maps, even if they don’t need them for bones as much as LW. I also was using them mostly for texturing in LW.
I will dig into this topic and see if it is possible with reasonable effort.
But since this is so fundamental and belongs into the “core”, maybe you should ask pmG once more for general support of weightmaps. Explain exactly why you need it and for what - maybe you can finally convince them.
Your fantastic work should have some “weight” in this regard.

Give me some time for the examples - this stuff is still under development :wink:

Cheers!


#16

Now for todays shader :slight_smile:

Has anyone ever dreamed of something like real splines for shading in messiah? While Gradients are fantastic, it is rather complicated to get precise values, roundings and interpolations and visualize them. Just tonight at sleep (where I work the most :slight_smile: - I always wake up with half-written shaders in mind) it dawned to me, that we already have perfect splines in messiah: the graph editor. Now I invented a shader that uses the curves you build in the graph editor not for animation but for interpolating/remapping your input! :bounce:

It worked on first try like a charm and is so simple that I just wonder why I didn’t think of that before:

Now what do we have here? This scene contains just the messiah “Ground” object and a Null at the center. A TLHPro:Distance shader delivers the distance from that Null as a value between 0 and 1. That radial value is connected to the TLHPro:SplineCurve Nodes Value input.
And here comes the cool part: Imagine that 0 to 1 distance mapped along the timeline from frame 0 to frame 100 like in the screenshot (this range is adjustable) - Now I “animated” the curve values between 0 and 1 using stepped keys (in the center/the first three keys) for hard edges, bezier keys and all available tcb stuff as you can see in the screenshot. Now instead of the 0 to 1 distance value you get the curve values over that range! That final value is then in turn plugged into a normal gradient that goes from yellow to red…

And you can use all kinds of graph editor tools on that like loops, local accumulate, oscillate. You can save the curve etc…

Was that understandable? Please ask if not :slight_smile:
This will be unbelievable useful for fine adjustments where gradients are just too coarse.
If you have ever worked with ZBrushs ZCurves you should know what I mean :bounce:

Cheers! :bowdown:


#17

You are a thinking man, this is a smart solution to get higher “resolution” in gradients!
Very useful:lightbulb

/ Svante


#18

Thank you svintaj :slight_smile:

Todays shader is a concept I have first seen in XSI, and immediately thought: I want this in messiah:studio.

TLHPro:RayType is a switcher node. Depending on the type of ray that hits a surface, a different material is getting delivered:

You may know the problem in messiah that you see the “Background” surface through the camera but the “Environment” surface in reflections, through transparency and with GI.
Therefore, most of the time those two surface have to be identical but often you would like a different Environment for GI etc…

In the image above, I use the same material on Background and Environment. It has TLHPro:RayType connected to its color input. As you can see, the normal camera rays see the blue clouds. On the glass objects, I used an incidence angle-gradient to make them reflective at the edge and transparent when viewed plain on. Now in the reflections you see a checkerboard texture on the background and through the transparency you see a colorful image of candy.

RayType has 6 separate inputs: Camera, Shadow, Reflection, Diffuse Reflection (GI), Refraction (Transparency) and Generic. The background/environment material above has the blue clouds connected to Camera, the checkerboard is connected to Reflection and the colored candy image is connected to Refraction.

Now this example is just that, an example to show what RayType does. More useful cases would be:
Use an image for camera rays and a pre-blurred version of that image for reflections to get fast blurred reflections (at least of the background).
Or use sharp images for all inputs but a very blurred version (HDRshop is great for that if it is a HDRI image) or even just a solid color or a gradient for Diffuse Reflection(GI) to reduce the grain and get better, smoother illumination.
This shader is also great for faking stuff or making interesting composites of unusual material behavior.

Since only one of the inputs is calculated depending on the RayType, the render overhead is the absolute minimum of calling a node.

BTW. the caustics are just there for the fun of it :slight_smile:

Cheers! :bowdown:


#19

Fantastic Thomas! Excellent additions. When will we be able to get our greedy hands on those.

Cheers,


#20

I fear it will be at least another month, maybe more, since I have still more stuff cooking and haven’t even started with the docs… (although those will not be as excessive as the ones for AoN:studio - this stuff is quite straight forward) :shrug:

I also hope to get some jobs to improve my finances so it may be even more delayed…

Cheers!