Shader with 36 diffuse textures!

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 06 June 2013   #1
Shader with 36 diffuse textures!

Hello community,

I am asking for your help and tips on this here. I am working on a project where we have one piece of geometry, one light situation but this geometry will have 36 different textures. So how could I build up a clever setup that if I have to change something on the shader, I don´t have to go thru all 36 shaders/files to change that.
My first intention was to create a master file then reference the light-setup and also the geometry. But then I would have to have 36 of these master files inwhich I would reference the shader and there I would apply the different texture. Doesnt seem where nice to me.

Another thought was to create different Renderlayers (for each texture one) and have one shader, but all textures change by switching the renderlayer. Is this possible? We work with vray and we would like to have the comfort of rendering multiple jobs at one time. So either by a little renderscript or the file itself should contain the correct setup.

Some tips or hints would help me and I really would appretiate that.

Thanks in advance.
Cheers Duke

Old 06 June 2013   #2
you could just have all those textures in an animation sequence and then animate it to the next texture frame when you want the next one to appear?

Old 06 June 2013   #3
If you have multiple objects, the easy way is using the triple shading switch. Look at documentation/videos for this to see what it does, it's probably better than me trying to explain it. You could probably adapt it to work for this single object based on some attribute by using expressions I think.

The other option is to use a layered texture, and just drag whichever texture you want to be showing to the top (make sure the blending mode is over and that its alpha is set to 1.). If the texture is transparent, you may have to set all the other alphas to 0.
Old 06 June 2013   #4
The layered shader is not supported by vray for some reason. The animation indeed could be something interesting but im curious if it will work with my 10k textures. Its a shame that there is no textureswitch node or something like that. Thanks so far.
Cheers Duke

Old 06 June 2013   #5
animation should work with 10k textures, when you´re using a file sequenz.
Old 06 June 2013   #6
So basically write out a 36frame 10k comp out of AEffects e.g. and import the sequence. Allright, ill give that a try.
Cheers Duke

Old 06 June 2013   #7
Check this "making of" video --> Making of "Gloam" At 6:40min he goes into Maya...he used vray and layered texture to combine multiple texture maps.
Maybe something like this might help with your situation.
Old 06 June 2013   #8
Originally Posted by THExDUKE: The layered shader is not supported by vray for some reason. The animation indeed could be something interesting but im curious if it will work with my 10k textures. Its a shame that there is no textureswitch node or something like that. Thanks so far.

Hmmm, I may have said the wrong thing. I meant layered texture, not shader. The layered texture allows you to mix textures in all kinds of ways, and plug the output into a shader. I believe layered texture is supported by V-Ray, though I personally don't use it, so I can't be sure.
Old 06 June 2013   #9
I believe in vray you have a custom slot of render passes in the shader and you can plug anything into it and render it out as passes

Old 06 June 2013   #10
Using the layered texture... sure.... but I would definately take the passes approach. Output each texture layer as a pass. If lighting conditions are great for 35 layers but screw things up for 1 texture layer, your single pass renders ruin your entire image. You can then throw anything and everything your compositor can handle to each layer.
Old 06 June 2013   #11
Thanks for the tips. I completely missed the layered texure. Since you can switch the layered shader also to a layered texture I thought you were talking about that. The "original" layered texture seem to work.
Now my only problem is how to control it. My first thought was to create a keyframe for each texture to blend. So Frame one is texture one at alpha = 1.0 at frame 2 it would be 0 so that texture 2 is visible. At frame 3 texture 2´s alpha would be 0 etc.
That way I can create my scripts for individually rendering each texture, have one single shader and I could easily rerender one single pass/frame by script.

I could not figure out the passes thing you were talking about. Can you explain that a bit more precisely please?

Thanks for your help so far. Its getting there


Ok so I thin I did find my solution:

I go by Render Layers and create layer overrides for the diffuse channel of the shader. So in each render layer I just drag the new texture into the slot and so far it seems to work fine.
Cheers Duke


Last edited by THExDUKE : 06 June 2013 at 08:19 AM.
Old 07 July 2013   #12
Its not clear to me when the textures are applied - over time or to different parts of the model. What about scripting the whole thing and using vars? You can then delete and rebuild in seconds.
If animation couldn't change the world, it wouldn't be such a Micky-Mouse place.
Old 07 July 2013   #13
As I mentioned I did this by Render Layers and Layer Override. You apply your shader in a renderlayer, pipe the texture into the diffuse channel and thats it. Then you copy the renderlayer, create a layer override (right click on diffuse channel), break the connection and reapply but this time the next texture.
My goal was not to have an animated sequence of textures. It was for a still project and therfore I did not need fancy things. It was just a convenience thing. Now I can create my renderscripts and easily can rerender some layers, or modify the shader and there is no need to modify 36 shaders.
Cheers Duke

Old 07 July 2013   #14
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 11:18 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.