User avatar
By oz42
#275718
Firstly, apologies for the extremely looong post (too many pictures - I really ought to learn how to do a video tutorial) but bear with me I think this is going to be good (at least I hope so!)

Although I don't use them very often (mainly because there is no visual feedback) procedural textures can be very useful and after having had some trouble recently with texture seams I thought I'd have another look.

When I was originally looking, a while ago, I found this thread on CGSociety http://forums.cgsociety.org/archive/ind ... 99741.html and followed the advice given by Atyss towards the bottom of the thread.

What I'm posting here is a revisit of that method together with the possibility of using XSI procedurals in Maxwell? (more in parts 2 and 3, later)


Showing XSI procedural textures in an OpenGL Viewport

01 - Insert a Primitive Sphere with a high number of subdivisions (or, indeed, any polygon mesh), assign an appropriate Texture Support (e.g. spherical, here), assign a Lambert material (this is important, as we only want the diffuse part of the shader because that is the only part sent to Maxwell) and attach an XSI Procedural shader node. The camera viewport is set to Textures Decal but we don't see a Checkerboard texture...yet!
Image


02 - However if you do a Render Region the texture appears.
NB: set your render region to mental ray or Maxwell will startup everytime you draw a Render Region (and you'll be drawing a lot of them!)
Image
Image


03 - Now if you insert a LightMap node (confusingly called Color Sampler!) and connect the Checkerboard to that instead and turn on the File Output option in the LightMap PPG (this will write a 2D image file in the Render_Pictures directory of the XSI Procedural texture, unwrapped via whatever Texture Projection you chose - NB only jpg and tga seem to work with Maxwell, the XSI version of tif seems to be unsupported)
You may need to draw and then remove a Render Region to update the LightMap before it will show in the OpenGL viewport
Image
Image


04 - This method will work for any XSI Procedural (I think, I haven't tried them all!). The LightMap will update after a Render Region re-draw.
Image


05 - The Render Region won't show the procedural texture yet as only the Lambert node is plugged into the Material's Surface shader.
Image


06 - You could plug the output of the LightMap directly into the Lambert's Diffuse input but better still, plug the image file the LightMap creates into the Lambert's diffuse (via a standard Texture Image node) (no need to plug anything into the Ambient input, as this is ignored by Maxwell)
Image
Image


07 - Now set your Renderer to Maxwell and Preview!
You now have XSI Procedurals in Maxwell - Hurrah! :D
Image


08 - As I said this will work with any XSI procedural texture - plus - you get the added benefit of seeing the procedural texture in the OpenGL viewport (don't forget to re-draw the Render Region to force the LightMap to update and re-write the jpg)
Image
Image
Image


09 - You can build the bottom half of the Render Tree (i.e. the input to the LightMap) as complex as you like; all XSI node are support (as far as I know) here I've even added some of the excellent EnhancedXSI shaders from http://www.shaders.co.uk - Go on, build some funky trees!
Image
Image

UNFORTUNATELY :( herein lies the problem; the Render Tree, however complex, is still an XSI render tree so it follows the rules of mental ray (the specular highlights on this Phong are from XSI's default light, not Maxwell's sun) - the LightMap just bakes the Surface shader into a simple image file. The effects of illumination are from mental ray, not Maxwell. So, in principal, it's nice to have XSI Procedurals in Maxwell, because they don't follow all the illumination aspects of Maxwell (which is, after all, it's strength) they're not much use :cry:

HOWEVER this brings me on to my second post - the possibility of using XSI's superb Render Tree to connect to Maxwell materials. I'm sure greater minds than mine have already considered this option but I'll press on regardless, just to get the idea out there! (I'll write a simple, non functioning, spdl and post my progress later...)

Thanks for listening.
Chocolate test with SSS

nice