(IT WORKS!!) rotate & scale shaders with-in an object. (update)

Started by TheBadger, September 06, 2012, 12:35:46 AM

Previous topic - Next topic

TheBadger

Hello.

Can someone tell me if there is a way to effect rotation and scale of a shader within an object?

To be clear, I am asking how I can affect the XYZ for rotation and scale of a single shader with-in an object node. While not effecting any other part of the object.

To visualize the problem:
Say you have a 2 rings. One smaller than the other. the smaller ring is placed inside the empty center of the larger ring.
Now imagine that you want to rotate the inner ring and change its scale too. *Please just except that the two rings must be one object, where each ring is its own shader with-in the object.

Thank you.
It has been eaten.

TheBadger

Ok, it appears to me that I can rotate and scale a texture on any part of a model by using a translate node. But It does not appear possible at all to do the same to the shader its self. Is this correct, or have I missed something?
It has been eaten.

Dune

I'm afraid I don't understand what you're getting at  :-[ If you scale/rotate a texture, that IS the shader, isn't it?

bigben

The transform shader appears to have no effect on image map nodes using spherical projection.
For objects it would be most sensible to have them mapped  to UV, and this mapping will (should?) overrirde any other transformations to the image map.

If the image your using as a texture is rectangular you could simulate rotation by editing the image with an offset in the direction of rotation but there are lots of IFs associated with that as to whether it will do what you want or not.

j meyer

Quote from: TheBadger on September 06, 2012, 12:35:46 AM
Now imagine that you want to rotate the inner ring and change its scale too. *Please just except that the two rings must be one object, where each ring is its own shader with-in the object.

As far as I know this is not possible in TG2.The only way I can think of would be
an obj sequence.

dandelO

To have free rule over your textures inside a model, create a 'transform shader' and select 'use world-space, final position'.
Now you can position/rotate/scale any shader that allows transforms.
I did a lot of this for the recent beehive models. All the wood shaders are fractal and I was able to transform them all to the correct orientations and positions to match each object part. You can transform a spherical plan image map, too, just use the transform shader for all transforms, leaving the image map shader's transform parameters at '0'.

bigben


TheBadger

Thanks martin.

Before you sent some help. I had rendered out the following animation. It was uploading just as I heard back from you.

The animation the way I did it, did not work. As I am sure you all would expect. However there is some interesting things happening.
While I did not get the texture shader to move with the transform shader (the way I had it set up) The light from the shader is moving as if the texture were also. its strange.
https://vimeo.com/48963732

Anyway I will try what DandelO gave me. And see how far I can get.

It has been eaten.

TheBadger

#8
Quote from: Dune on September 06, 2012, 03:05:58 AM
I'm afraid I don't understand what you're getting at  :-[ If you scale/rotate a texture, that IS the shader, isn't it?

Hey Ulco,

You got me a little confused now. In the shader they look like there all one. But I know that the object is independent from the texture since even in TG2 I can change that. The object is the same regardless of what texture I put on it. So I don't know now.

I had thought that because the object is separated from the texture, regardless of mapping (I don't want to change the mapping! just the part of the texture that is with-in the map- over time) that I should be able to make some effects.

I realize that the object is the object. Meaning the control panel in the objects tab is where I can control the position and scale of the object.
But with-in the objects node. In the parts shaders. I wanted to effect change to the texture.

I think it is still possible. I may not be able to do exactly what I wanted, but something should happen. Unless staff chimes in saying they know for sure that I cant do anything like I want, then Ill keep trying.
It has been eaten.

TheBadger

#9
oops
It has been eaten.

TheBadger

#10
QuoteTo have free rule over your textures inside a model, create a 'transform shader' and select 'use world-space, final position'.
Now you can position/rotate/scale any shader that allows transforms.

Martin, Can you please expand on this. I have been trying to make this work. But its not showing any effect. If it will work, its not by the way Im doing it.
Where are you plugging in your transform shader at? I would have thought that it would be the shader in question see below,
Hope you have your red pen handy.


I did try the file you sent. I think from that the power fractal is the best option since I could see a difference from seed changes. I''ll test an animation with that next. I also liked the effect from a simple shape shader, though I could not see a way to make changes in the effects appearance over time.
And rotating the simple shape shader its self is good, but it looks the same from every angle. Perhaps I could apply the simple shape to the image map of the texture (not the primary) and than a transform on top of that? not sure if there will be any visual effect though.
It has been eaten.

dandelO

Assuming 'inner shader_1' is what you are trying to transform, you'll need to take the output of 'Inner shader_1', plug it into the transform shader's right-hand input and then the transform shader plugs into the object part 'inner_1'. Just leave the left-hand input empty on the transform shader.

I can't see what you are trying to move here as there is nothing feeding any of the 'inner shader_1' inputs. Unless you have image maps assigned in the settings? I'm don't think you can transform images assigned to object UV's but I know you can move around other projection types. I'd rather not load the images in the default shader but import a new image map shader and use it from there(much more options for image map shaders than there are for images loaded in a default shader). Plug the image map shader into the default shader's luminosity function and then finally the transform node into the object part.

If it doesn't have images loaded and the 'inner shader_1' node just has a simple flat colour you won't see any effect from the transform shader as it's just going to move the solid colour to a different area.

dandelO

I'd set it up something like this image.

[attachimg=1]

As long as the 'inner shader_1' has something to take some function values from(the image map shader in this case, but it could be any number of other shaders), then you should be able to shift the lot around easily before it goes into the object part.

TheBadger

No joy Martin.

This is strange.
I got the sub surface scatter effect to work. I can make an object look like it has a semi transparent skin, and I can make it look like there is something beneath the skin. But animating one of the layers is not so simple.

At this point I would like to ask you if I can send you the files and textures to take a look at? I realize you have your own projects and work, but I think that I will not get any further on this on my own, or even with this tread. You will have to have the files to know for sure yourself.

Please PM. your email if you would like to take a look at the files. I am not sure I still have the address.
If you don't have time don't feel bad to tell me no.

Cheers.
It has been eaten.

TheBadger

Hi.

After DandelO got his hands on the files a solution was found. It works very well by the way!
All Hail DandelO! Or see for your selves  ;)

https://vimeo.com/49082546

[attach=1]
It has been eaten.