eg. I make some alpha leaves, put them on some geometry and now I want to bake loads of these down to a plane
Ideally this would be a solution that works in maya 2018 ..
any suggestions? The main thing is that the bake needs to support alpha blended transparency
thanks
Replies
Something like making that; actual geometry out of your cutouts, or more like scattering your alphas on the texture like a stamp? Usually we'd use a scatter brush in photoshop or something to do that.
Based on your post history, you probably know all this already, but in case it helps someone else, http://wiki.polycount.com/wiki/Texture_Baking#Transparency
I have a feeling this might be doable with Arnold as you dont need to go through transfer maps so ill check that later.
Fwiw I'm pretty sure I've had this working in max through rtt - it might have been with mental ray rather than the scanline renderer though.
I suspect that's where illI end up.
If anyone from simplygon is reading this - Ill say nice things about you on the Internet if this makes it into v9
we ended up writing our own tool to do this.
There's a couple of ideas to try here and it's not out of the question to write a tool if necessary.
Workflow wise I started modeling leaves out and just having straight up geometry to bake with UVs corresponding to some leaf texture, but this isn't practical for more detailed leaves.
Now with megatextures and their atlases having proper normal/height/ao etc... building your own custom stuff using alpha card geometry and rendering that out makes sense.
TLDR Did something similar back in the day, but can't figure out how to do it anymore, but bumping in case someone else knows how to do it.
I think you're missing the actual problem. I need the baker to be able to account for alpha in a texture that's applied to the source mesh.
The card leaves example is the simplest - you make some leaf textures with alpha, arrange them into a tree shape and then bake that to a mesh that has a closed volume. (imagine baking the bushes in fornite down to a sphere)
if the baker doesn't understand alpha, then you don't get correct colour, shadowing, occlusion and so on because the upper layers of the source bmesh obscure the lower ones.
Like a number of others here Im confident I had this soved with mental ray a few years ago but it's not an option now because you only get Arnold (which I'll look into)
I'm attempting this in Arnold since that is built into Maya these days.
First thing you need to do is set the attributes of the meshes you want to use opacity, under the arnold section, uncheck opaque. If opaque is checked, it doesn't matter what settings or maps you have plugged into your graph if that opaque checkbox isn't unchecked opacity won't work.
My graph network looks like this
- With my graph, I created 2 aiStandardSurface shaders.
- The first one I called AOMaterial and created an aiUtility node and an aiWriteColor node.
- In the aiUtility node I set the shade mode to ambocc and color mode to color.
- In the aiWriteColor node attributes I created a new name called AOAlpha. This creates a custom AOV which I'll touch on later.
- I attached those graphs as shown and also connected a normal and an opacity texture
- On the second material I connected the opacity and basecolor texture.
First i apply my AOMaterial shader to my geometry, and for the render mode AOV in render settings I select "AOAlpha" which I had named before in the aiWriteColor node. This is sort of a custom render pass, Arnold has a few built in but none for ambient occlusion, and while there is an Arnold ambientOcclusion shader it had the opacity inputs removed "by design" in Maya 2018. If you hit render you should get an AO map with alpha enabled and extra detail since the normal map was plugged in.Next i set the "Mode" to N which is my normal map You would have to add it to the active AOV list before it shows up in the mode dropdown). When you render you should get a normal image, now I couldn't figure out how to get this working properly, I suspect it is rendering some sort of worldspace normal and also backfaces are affected too, I don't know enough to delve into fixing that so maybe someone else does.
Next I assign my AlbedoMaterial shader to the meshes and render out using diffuse_albedo (there is a plain albedo but just ended up rendering white for me). When saving the file out I saved with color management embedded because without it the file came out really dark. I reckon one could use that same slot for their other maps like curvature that they might want to transfer over.
3D is so weird sometimes. This doesn't even work properly in max, at least the last version I tried when you RTT any partially transparent pixel gets rendered black
I can't say about Arnold as I don't use it, but with Blender Cycles it def seems to work, baking AO and shadows takes transparency into consideration if you use the texture alpha (or something else) as a mix factor to mix your opaque shader with a fully transparent shader:
And the transparent diffuse:
Thanks so much for that m4dcow. I'll give it a shot as soon as I get over my current problem.
I'm looking at ways to get the normals behaving correctly on an arbitrary mesh but I fear it might not be possible within maya's architecture as I can't see a way of extracting tangent information from the target mesh and passing that into the source mesh's shader.
I'm not giving up just yet mind..
- For the Normal : We need to render with a Ortho Camera.
- Face Down the camera to match the World Space Axis with a plane's tangent normal (Camera set to Ortho)
Then we change the Shade Mode in aiUtility to Flat , Color Mode to Normal (AOV still be our "AOAlpha"), and hit render we got this (the brown yellow one is the backface,we'll fix it later) , you need to turn the gamma off in the render window.In case you want the camera Face another Axis , for example :
Then we need to change the connection between aiUtility & aiWriteColor like this(out Red to in Blue;out Green to in Red;out Blue to in Green)
- For the Backface : We use aiTwoSided node , Front input of the node we use the above Output Color , the Back input will be another Material's Output Color with Normal Map input Inverted Z , the Graph like this :
Then we hit Render and the Backface Normal's fixed :
That's it . Hope this can help someone , and sorry about my English.
Thanks m4dcow again.