Forests in maya mental ray.


#641

And here are the UV’s and shader “network” for the grass, the long grass from the scene just posted. It’s customary for me to use “some random file” when trying to achieve a certain color scheme, as well.

UV’s are pretty straightforward in this case. An opacity map would work fine too, with actual painted blades. Very basic grass obviously, but works for a nice little “wild grass” object and paints up quick with spPaint3D.


#642
  1. Apply your grass shader to the Poly Geometry. For me, this is a Blinn with a MR override and a mia_material_x using mostly the settings we’ve gone over in this thread. Translucency as well. In my shading group, this mia_material is connected to the material and shadow slots, and also the photon slot if you’re using GI (which you shouldn’t be for exterior scenes). You could use a cutout opacity on your grass, but it depends. If you tweak your initial PFX enough you won’t have to, but then again a more complex initial PFX setting means more polys. Use a cutout opacity if you need lower polys but more detail. UV’s are not an issue with most of the grasses I’ve played with, but of course you’ll want to make sure they work with your opacity map, if that’s what you’ll be using.

I’m confused as to how you are using a Blinn and a mia_material_x. Are you saying some of the blades of grass (faces) are using a blinn while the other blades (faces) are using the mia_material_x? Or are you saying somehow you are connecting the two materials together to become one?

Thanks again for your help. I really appreciate it.


#643

I apologize for the confusion. I’m sharing my workflow both as an outline and also to accept critiques from other, more seasoned Maya users. Since the method for mass grass and mass trees is similar, I’ll continue.

For every material applied to objects in Maya, you have a Shading Group. In this shading group, there is a mental ray section, where you plop your MR shaders. In this case, they’re all the identical grass shader, which is similar to the Blinn shader in the first slot in that they both use the same File Texture node. This way if I want to try different file textures, or a painted UV-style texture even, it’s a simple change and it’ll update both the Blinn and the mia_material_x.

The reason to use a Blinn in the “surface material” slot is twofold: if I need to render in Maya Software, it’s ready to rock, but more importantly the Blinn shader also drives the Viewport appearance of my grass or tree. By checking “Suppress Maya Shaders”, mental ray ignores the Blinn entirely in favor of the mia_x. I have always made all my materials the same way: a Blinn for Maya Software and the overrides for my mental ray materials too. Used to be I’d flip back and forth constantly between renderers. But mia_material_x doesn’t work well in the Viewport, if at all. Thus, you connect both and you win!

To clarify your last point, in a tree object there would be multiple Shading Groups applied to multiple faces - but I don’t do this manually, it’s simply a result of the Combine function when unifying my trees to use as instances. Until I learn a way to instance Groups instead, this is the only way that spPaint3D (for example) will instance things. It has to be one shape node, for whatever programming reason.

So when selecting this tree object with multiple Shading Groups applied to the various trunk, branch, and leaf parts, in the Attribute Editor you see all these shaders, not just the Blinn or the mia_x. You simply scroll over to the right, and they’re all there.

But in all cases, the Blinn and mia_x wouldn’t be applied to different faces. They would be applied to the same faces. Hope this helps and that my English makes sense!


#644

Hey Infernal, the mia_material works fine in viewport. All you need to do is to go to your UV Editor and select the right file in your texture Tab/Menu! Then, all your texture will be visible in your viewport! No need for complex shaders.


#645

Ok, so im reading the thread again and it seems that I need to find my answers by my own.
However. In the first pages someone mentioned that I would need 2 Proxies for the whole tree. One for the bark, and one for the leafs. That brings up the question of the painting. Can I, after setting up my proxies, somehow transform constraint or parent the two proxies in order that they dont get painted individually in world space, but more as a tree ( as it should be)?
Ive made a quick test and it seems that it might work. I would like to hear some of your experience with that.

Next thing is the shader…again…still! Erm…so since ive gone thru this thread a couple of times I assume that you guys go more into the single shader/texture but with different leafstyles according to the UV layout…right instead of having multiple leaf clusters with different styles and shaders. First would make more sence in order to keep the object count low…also for the proxyshapes.
But can anyone pls give me also a hint with that multiply divide node? Im stuck there aswell…

And do I need to assign the shaders also to the proxies? I assume Yes!?

Thanks for reading…


#646

Just wait till you gamma correct those mia_materials. That’s the main reason I use the exact same set-up as Infernal. Also, if you create procedural shading networks it’s much easier to test them with IPR in maya software imho. This shader set-up makes for a really quick workflow. Before i discovered this same set-up I used to use a MEL script I wrote to toggle between mia_materials and blinns for viewport display and quick maya software tests. This shader set-up pretty much made that workflow unneccesary and simplified it quite a bit because there is no longer a need for a MEL script…well, except to quickly toggle between preview lights and final lights and renderers. I still use that part of it. :slight_smile:

-Justin


#647

Maybe i didnt get you but the right cube IS gamma corrected! As long as you choose the texture file it will be displayed as it is! The gamma will be ignored and is basically usless for the viewport anyway.


#648

yea the gamma is totally useless for the viewport. i didn’t maximize the thumbnail of the image you posted so i didn’t see the gamma correct and un-gamma corrected cubes. i’ll give this a test later on! but i still like having a shader i can preview in maya software as well, so i’ll still be using that set up Infernal posted about. but that’s just my personal preference. :slight_smile:


#649

Just out of curiosity…why do switch forth and back between the two renderers?


#650

I only use mental ray shaders with no maya shaders attached to the shading group at all…, since I can choose which texture shows up in the viewport with the UV texture editor, I don’t need them anymore.

And to have all shaders duplicated is not a good thing I guess, lots of nodes to handle :stuck_out_tongue:


#651

And to have all shaders duplicated is not a good thing I guess, lots of nodes to handle :stuck_out_tongue:

As I said, that’s just the way I work. Not necessarily “the best way”. I often need to use Maya software for compositing purposes and also for test-renders when I don’t need to test lighting. I don’t feel that having one more node per shading group is “lots” at all though… I’ve always done this, and switching my textures in the UV editor just seems backwards to me. Having Maya materials working properly is necessary in my workflow - the MR shaders are just for MR renders of course! But considering all the things that are “broken” about mental ray and/or just plain tedious, it’s beneficial for me to be able to switch back to Software for quick, painless comp renders then switch back to MR any time. (shrugs)

That said, in many cases instancing “breaks” when you turn off FG and of course it doesn’t work at all in Maya Software. For the sake of forests, my extra Maya material workflow would be entirely pointless. Until Maya Software gets something like BSP2, it’s utterly useless for instancing purposes. A scene that renders fine in mental ray using 2 to 4GB of RAM could require 48GB or more in Maya Software, and I simply don’t have access to a workstation of that caliber anymore. I miss my Apexx4!


#652

Well, one maya shader per mental ray shader is the same as to multiply the number of total shaders by 2 my friend! :smiley:

BTW, as you pointed out early, it’s just a matter of what works for you, so it’s fine if it does. I use proxies, so the use of maya shaders is absolutely pointless for me.


#653

I use maya software renderer with IPR to quickly develop and test procedural shading networks and textures. You could use mental ray IPR, I just prefer using the maya software because it’s always been really stable and blazing fast to just test textures. That’s just my preference, though. :slight_smile: Maybe for forests and grass and things of that nature it’s not as ideal, but for objects where you don’t have to worry about instancing it’s not a big deal.


#654

hey tastao_wayne, I’m wondering if you ever completed your script to create trees you posted on this thread on page17. I clicked the link you provided but I didn’t see anything or anywhere to download it. Plus it was in Spanish which I can’t read. Anyway, if you have a revised or working version of it, I would love to get my hands on it.

Thanks!


#655

Allrighty…so here´s my result on a proxy-grass! 1x1m … about 28000 Proxies painted! Plus a tree with 9 different leafstyles. Thanks for the amazing script btw.


#656

@THExDUKE: That really looks great, both the grass and the tree! Good work there my friend.


#657

Hehehe…cheers mate! It was a struggle but its worth! I have learned a lot last week! Reading this thread for a couple of times did the job. So much information in here. This is a really valuable thread! Thanks for your support aswell! :wink:


#658

Hey infernaldarkness, I’m trying to export out a tree from onyx broadleaf but don’t see where I can export out resolution-1 uv’s. All I see is Plates and the uv’s always come out looking like the example on the left on page 9 of this thread.

Thanks for any help.


#659

Hey infernaldarkness, I’m trying to export out a tree from onyx broadleaf but don’t see where I can export out resolution-1 uv’s. All I see is Plates and the uv’s always come out looking like the example on the left on page 9 of this thread.

Inside OnyxBroad exporter, click on the “Plates” box itself. You need to increase your “Number of p-objects” on the top left to at least 1. If you go to 9, for example, you get 9 leaf-groups for ease of texturing. I generally use 2, but if you’re using Tastao_Wayne’s script you only need one.

Now all those options on the LEFT there in the Leaf Plates panel work, and your UV’s will appear in Maya as they appear in Onyx. I had the same problem too, others helped me through it.


#660

Thanks infernaldarkness!