Object Inheriting coloration from the surface?

Started by N-drju, April 18, 2020, 02:09:27 PM

Previous topic - Next topic

N-drju

So I use Ulco's parkwood grass clip with a few tweaks of my own. I have a nice "carpet" of grass where I want, but I would also like to have actual grass objects here and there.

Now, comes the tricky part... How can I make the grass take on the surface colour that is directly underneath it?

I want to do it this way, to make the transition from "carpet grass" to "overgrown grass" less noticeable in terms of saturation. I tried to pin Ulco's shader directly to the object parts and through the transform input shader. Unfortunately, the difference in colors is still quite pronounced...

I would like to use the good, old Mr.Lamppost's grass pack as objects (http://www.mrlamppost.com/tg2/downloads/objects.htm).
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

N-drju

Ok, it looks like any surface layer is, after all, automatically translated onto an object provided there is a loose "transform input" added to it and attached as an object's color. The reason why it wasn't noticeable was due to a combination of factors. Most notably the displacement in the original grass layer which was being rendered onto the grass object, darkening, unsurprisingly, the object itself.

But it looks like the grass tint is under my control now. Here's a shot in "false colors".

traw.png
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

sboerner

Interesting. You're attaching the output of the surface node to the object's internal shading network? Is the transform node set to worldspace?

Dune

That's the way it works indeed. I use that method a lot with the internal grass too, being careful to mask out any gravel areas (grey grass).

So to reiterate for newbies: indeed add a transform shader in your object parts area, set to world space and get the shader into its input by rightclick and find the grass shader from the popup menu. Often it is easy to begin its name by an A or 1, so it's on top of the list.

But making it really fit needs some extra work. Mostly they end up too dark, so I up the default color in the object part(s) to a number between 1.2 and 1.5. You can decrease the opacity to 0.7, and set translucency and reflection to kind of fit. Depends also on whether you have any Lambert shader or reflections in the original grass shader clip.

sboerner

This is crazy useful.

You could also expose the parts shader input on the main level and connect it that way.

WAS

I wonder if it's the best method though. If you have a lot going on for surface textures, and feed that to an object of blades where most the detail won't show on vertical, you may be better off duplicating the shaders you actually need for the grass. Especially if your having TG truncate extra data like displacement, masks, etc. Most my surface shaders are much tougher than what's needed on objs in my experience, or yours objects can get noisy plus blotchy.

N-drju

Quote from: sboerner on April 18, 2020, 08:01:03 PMInteresting. You're attaching the output of the surface node to the object's internal shading network? Is the transform node set to worldspace?

Exactly like you say. But I do admit - it needs some extra adjustments, when it comes to tone colour. Shadow from the object plays a role as well and changes the resulting coloration. It will not be the exact same colour mix.

Quote from: Dune on April 19, 2020, 01:43:26 AMBut making it really fit needs some extra work. Mostly they end up too dark, so I up the default color in the object part(s) to a number between 1.2 and 1.5.

In fact, you don't even need a default shader. You may also duplicate the surface shader and leave it unattached in your node network. That way, you can make adjustments to the colour, without default shader's settings. It all depends on which kind of workflow you like.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

sboerner

QuoteI wonder if it's the best method though. If you have a lot going on for surface textures, and feed that to an object of blades where most the detail won't show on vertical, you may be better off duplicating the shaders you actually need for the grass. Especially if your having TG truncate extra data like displacement, masks, etc. Most my surface shaders are much tougher than what's needed on objs in my experience, or yours objects can get noisy plus blotchy.

All very good points. But still worth experimenting with, I think.

Some of the extra data, like masks, would be the reason why you'd use this. Maybe undesired data, like displacements, could be overridden by dividing the main line – duplicating the surface shader and modifying it where necessary – then feeding that to the object.

N-drju

On the second look, I am not entirely sure if displacements really do play a role. I just rendered another image with all displacements kept and there really was no difference in the colour tint... I actually made a comparison. The grass looks just the same... ???
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Dune

If fed into a color input, all displacements will be out. It's easy and fast, so I wouldn't bother copying stuff, especially with the danger of losing masks. Just work a bit on the default shader to get a similar shading, and have your grass pop fade out into the distance (soft mask).

N-drju

I have made some more tests and I can conclude that the colour accuracy will largely depend on how the surface shader looks and the input you choose for a transform shader.

For example, your Parkwood grass can yield better results not by applying "grassland" node to the transform input shader, but other output nodes upstream. The "bloemrijk" node added directly into the transform input has hues that are much closer to the original. Compare (false colours again):

gr1.png     gr2.png     gr3.png

All have diffuse set to 0.75 and translucency to 0.2.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

N-drju

Oh, and a real important thing - I should probably mention that I have also removed an image file from the default shader and set translucency and diffuse to shades of white. So yes, some extra effort is needed to obtain "neutral" results. ::)
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

WAS

Quote from: sboerner on April 19, 2020, 01:50:53 PM
Quote from: undefinedI wonder if it's the best method though. If you have a lot going on for surface textures, and feed that to an object of blades where most the detail won't show on vertical, you may be better off duplicating the shaders you actually need for the grass. Especially if your having TG truncate extra data like displacement, masks, etc. Most my surface shaders are much tougher than what's needed on objs in my experience, or yours objects can get noisy plus blotchy.

All very good points. But still worth experimenting with, I think.

Some of the extra data, like masks, would be the reason why you'd use this. Maybe undesired data, like displacements, could be overridden by dividing the main line – duplicating the surface shader and modifying it where necessary – then feeding that to the object.


That's true. Wouldn't it be easier to have a master mask driving where shader grass is, and using that to define where object grass is, and using a duplicated shader with less roughness for quality?