Simple shape shader woes!

Started by cyphyr, October 28, 2010, 07:50:55 PM

Previous topic - Next topic

jo

Hi dandelO,

Thanks for that. It's led me to some interesting conclusions such as:

- Even the image map shader won't be redirected if you hook it up to the Blending shader input of a surface layer, as Richard had it originally. It's the same with the Colour function input and I'm guessing the other "property" inputs such as Luminosity etc. However if you hook it up to the Child layers as you did in your example input it will redirect.

- Even if you hook it up to the Child Layers input the Image map shader still won't redirect unless you turn on the displacement settings in the Power fractal feeding the redirect shader. I had a frustrating time with this not working with the image map shader until I clicked that I needed to change the displacement settings.

This suggests to me that as I said this only works with the displacement side of shaders, which is what the Redirect shader is dealing with. When I was looking at this in the debugger I noticed that there was some sort of conversion going on. I forget what it was right now!

I've attached an image and screenshot showing what Richard was attempting "working". Whether it's quite what he was aiming for is something else :-). However I did have to change the Simple shape shader to use the position in texture for the warping/redirection to work, so you won't actually be able to replicate the results in the current version of TG2. I'd overlooked where this was being done in the image map shader. I will add a param to select between final position and the position in texture.

Regards,

Jo

dandelO

QuoteI will add a param to select between final position and the position in texture.

Excellent! 8)

Actually, to redirect or warp any shader, you must use the displacement controls of the redirecting/warping function. This isn't really documented anywhere and is probably the reason that many people have trouble, more so with the warp shader in particular. A redirection kind of suggests that you'll need to add some displacement, warping is more cryptic in this regard, I think.

As for the redirected image map shader, I only set it as the child of a surface layer to show how it didn't need connected to the actual main network to take its coordinates from, it supplies them itself, according to its plan setting. You can obviously omit the surface layer and hook it up to the network in series and it will redirect in the very same way, except it will also redirect any previous shaders in the network, too.

So, with a new simple shape shader in the works, any chance of a wee rotation control in the transform shader, again... :P ;)

cyphyr

Thankyou Jo :)
Yes that was exactly what I was trying to replicate. Goms did come up with an alternative that will work for my needs for the moment. Your improved s³ will I think be a great improvement when released for the next update (?)
:)
Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Matt

I hope this doesn't confuse things even further, but I see a lot of confusion over the purpose of the Redirect and Warp Shaders.

The 'redirect' in the name Redirect Shader means "redirect a displacement shader to displace along the X/Y/Z axis instead of the surface normal". Its only purpose is to change what direction a displacement shader works in, because most displacement shaders only displace along the surface normal. The Redirect Shader allows you to make sideways displacement, for example. Now, if you apply this to a surface (e.g. your terrain) and you have some other shaders, whether they are displacements or colour shaders, they will be affected by the displacement as long as those shaders work with texture coordinates, not final position. (If the shaders work with final position, they will just appear to be 'pasted' over the top of the displaced surface without bending sideways with it.)

'Redirect' is completely different from the Warp Shader. The Warp Shader allows you to use a displacement shader to distort the texture space used by another shader, which means you can warp, distort or move a particular shader without actually affecting anything else about the surface.

Redirect Shader is easily confused with the Warp Shader because, quite often, both shaders are used together to achieve a particular effect. For example, if I want to warp a texture space in 3D, the displacement that describes the warp might need to be in X, Y and Z directions. To do that I use a Redirect Shader with 3 displacement shaders attached to the X, Y and Z inputs. That Redirect Shader then becomes a 3D displacement which I plug into the warp shader to tell it how to warp the texture space of another shader. Only shaders that work with texture coordinates, not final position, will be affected by the Warp Shader.
Just because milk is white doesn't mean that clouds are made of milk.

mhaze

Hi

I've been developing a picture around this and have learn't a lot from this -thanks Goms, but I still can't get rid of the noisy spikes. Any help gratefully received. Mick