|
created corner vertex baking - maya mel/python
on 06-16-2010 11:19 AM
I saw this somewhere and I was wondering if someone knows the same script for maya. Would be really appreciated.
http://www.neilblevins.com/cg_educat...x_map_wear.htm
This would do the darkening of the edges by angle or convexity of the mesh.
Probably we can call it as a convexity map as Xnormal does? But I would like to know if anyone knows a script of this for maya?
Last edited by bugo; 06-17-2010 at 05:50 AM..
|
, dedicated polycounter,
1,463 Posts,
Join Date Feb 2006,
Location Redmond WA
|
anyone? :/
|
, dedicated polycounter,
1,463 Posts,
Join Date Feb 2006,
Location Redmond WA
|
Just pulling this out of my head (i read the script a while ago) but someone with even limited MEL should be up to writing this
*per edge in the mesh get its connected faces
*find the angle between the faces. acos(faceNormal_1•faceNormal_2)
*if the angle is between a low and high value then collect the edges verts
once you've processed all the edges colour the verts
|
, veteran polycounter,
2,970 Posts,
Join Date Feb 2010,
Location Ireland
|
I might give this a shot tonight. Seems like something I'd use too
Ideally I'd like to do a full surface-curvature to vertex color script, but that'd probably be intensely slow in MEL and better to do as a plug-in. Might be time to dust off Visual Studio again...
|
, MoP,
11,603 Posts,
Join Date Oct 2004,
Location London, UK
|
After the last bigger thread about curvature i started fiddling around a bit with this.
Here's what the current output looks like.
It's in WIP state, and has some quirks related to undo ( also doesn't support undo in this state ), but if you really need it i can send you a .pyc or drop it online.
The little dark splotches come from the raw output of the current algorithm, smoothing the vertex-color once or twice helps that tho.
Last edited by rebb; 06-17-2010 at 02:06 PM..
|
, triangle,
372 Posts,
Join Date Jul 2006,
|
Cool, can you bake it down to a lowpoly as a texture?
|
, Moderator,
8,633 Posts,
Join Date Oct 2004,
Location Iowa City, IA
|
Yep, here's an egghead example 
Its just baked to a sphere thats why the ears are being sampled strangely.

|
, triangle,
372 Posts,
Join Date Jul 2006,
|
thats cool rebb, wonder if u can share that with us somehow?
|
, dedicated polycounter,
1,463 Posts,
Join Date Feb 2006,
Location Redmond WA
|
may i ask how you differentiate between convex and concave angles. maths not my thing but i could get this going in max if i had the idea. i had considered doing it with a ray cast but that would be pretty slow
Last edited by r_fletch_r; 06-18-2010 at 03:16 AM..
|
, veteran polycounter,
2,970 Posts,
Join Date Feb 2010,
Location Ireland
|
I am working on just that atm. for 3dsMax. I got a nice script from a buddy that blends hard edges and together with gradient mapped material and a mask for the chipped effect you could do just that.
The one labeled as worn map assigns a vertex color based on edge vertex angles. A gradient material with the 3rd UV channel (color channel) is used to get more fine control in the material which can then be baked into a material or used as a mask.
I am working on another script that converts a texture back to vertex colors so one can create complex materials that blend or mix in the vertex colors as a input.
|
, veteran polycounter,
3,037 Posts,
Join Date Mar 2008,
Location Sydney Australia
|
rebb: Awesome!
renderhjs: Nice overview too.
|
, MoP,
11,603 Posts,
Join Date Oct 2004,
Location London, UK
|
Ok, i've put it up here .
It has different .pyc files for different Maya Versions ( 2009-2011 ), copy them into your script folder and load up the .py file.
There's also some basic instruction inside the .py .
@fletch :
Looking at the Pits&Peaks Script renderhjs mentioned, it works pretty similar to that.
@Mop :
Thx 
Last edited by rebb; 06-18-2010 at 09:33 AM..
|
, triangle,
372 Posts,
Join Date Jul 2006,
|
Cool beans, thanks!
|
|
I LOVE YOU REBB <3
Edit: Just tried on a more heavy-duty test case, this time a 350,000 triangle decimated mesh from ZBrush.
It took just over 90 seconds to calculate, which isn't too bad. I think the results would be better if the mesh wasn't run through decimation master, but obviously it'd take a lot longer to process. After doing Smooth a couple of times on the result I think it'd be good for most uses anyway.
My next step is to try hooking this up into a shading network to control material parameters through the red/green vertexcolor channels 
Shame that Maya makes working with vertexcolor in Mental Ray such a total bitch.
|
, MoP,
11,603 Posts,
Join Date Oct 2004,
Location London, UK
|
Nice! The first thing that comes to mind is how useful that looks like it would be for controlling subsurface scattering. That would do wonders as a mask for a SSS map.
|
, veteran polycounter,
3,267 Posts,
Join Date Oct 2004,
Location Kirkland WA
|
Looks very sexy, Mop :P
The next version should be a little faster as the algorithm is simplified some, also with undo support. The problem with undo support tho is that it will add some extra memory useage for each time the command is invoked ( because Maya has to hold the undo information ), but it should only be something to look out for with high vertex-count meshes.
|
, triangle,
372 Posts,
Join Date Jul 2006,
|
just looked at it now, THANKS REBB! This is just what i wanted man! Wonderful to find such a great thing. Now it's just a matter of baking it, putting some noise filter into it and consider it as a worn mask. Damn, this is good!
Last edited by bugo; 06-20-2010 at 11:02 PM..
|
, dedicated polycounter,
1,463 Posts,
Join Date Feb 2006,
Location Redmond WA
|
this is ace...i can think of many applications...cheers
senior lighting artist @ r*north
|
, veteran polycounter,
3,423 Posts,
Join Date May 2006,
Location edinburgh
|
This looks fantastic, and super useful. I have been hoping for a Mudbox realtime shader doing just that, in order to check for surface continuity (as a full heatmap, rahter than red>black>green tho)
This however looks great as a base map to bake! Mop, did you manage to bake this to texture successfully ?
|
, veteran polycounter,
4,949 Posts,
Join Date Oct 2004,
Location Irvine CA
|
Yep, any app that can import/bake vertexcolor will do this fine.
Also, I checked and the Maya 2009 script works in Maya 2008 too 
|
, MoP,
11,603 Posts,
Join Date Oct 2004,
Location London, UK
|
What kind of profit can i get with convex&concave maps?
|
, triangle,
379 Posts,
Join Date Jun 2009,
|
lots of $$$
concave map = areas where dust and dirt might settle
convexity map = exposed areas that might be damaged/worn-out more.
|
, polycounter,
865 Posts,
Join Date Jan 2009,
, Polycount.com Editor,
6,678 Posts,
Join Date Oct 2004,
Location Boston USA
|
somewhat related, a MR shader that does the same:
http://www.tomcowland.com/mentalray/...ure/index.html

it supports tesselation with barycentric interpolation which results into smoother results if you want to bake or render stuff into bitmaps.
Different but also nice:
http://www.rpmanager.com/plugins/TensionMod.htm
(to bad its just max and plugin only)
|
, veteran polycounter,
3,037 Posts,
Join Date Mar 2008,
Location Sydney Australia
|
Really useful as well renderhjs. Kinda easier to bake since it's a mentalray node.
|
, dedicated polycounter,
1,463 Posts,
Join Date Feb 2006,
Location Redmond WA
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Copyright 1998-2012 A. Risch
|