Author : disting


Reply
Reply
 
Thread Tools Display Modes
bugo's Avatar
Old (#1)
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..
Offline , dedicated polycounter, 1,463 Posts, Join Date Feb 2006, Location Redmond WA Send a message via MSN to bugo Send a message via Skype™ to bugo  
   Reply With Quote

bugo's Avatar
Old (#2)
anyone? :/
Offline , dedicated polycounter, 1,463 Posts, Join Date Feb 2006, Location Redmond WA Send a message via MSN to bugo Send a message via Skype™ to bugo  
   Reply With Quote

r_fletch_r's Avatar
Old (#3)
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
Offline , veteran polycounter, 2,970 Posts, Join Date Feb 2010, Location Ireland  
   Reply With Quote

MoP's Avatar
Old (#4)
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...
Offline , MoP, 11,603 Posts, Join Date Oct 2004, Location London, UK  
   Reply With Quote

rebb's Avatar
Old (#5)
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..
Offline , triangle, 372 Posts, Join Date Jul 2006,  
   Reply With Quote

EarthQuake's Avatar
Old (#6)
Cool, can you bake it down to a lowpoly as a texture?
Offline , Moderator, 8,633 Posts, Join Date Oct 2004, Location Iowa City, IA  
   Reply With Quote

rebb's Avatar
Old (#7)
Yep, here's an egghead example
Its just baked to a sphere thats why the ears are being sampled strangely.

Offline , triangle, 372 Posts, Join Date Jul 2006,  
   Reply With Quote

bugo's Avatar
Old (#8)
thats cool rebb, wonder if u can share that with us somehow?
Offline , dedicated polycounter, 1,463 Posts, Join Date Feb 2006, Location Redmond WA Send a message via MSN to bugo Send a message via Skype™ to bugo  
   Reply With Quote

r_fletch_r's Avatar
Old (#9)
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..
Offline , veteran polycounter, 2,970 Posts, Join Date Feb 2010, Location Ireland  
   Reply With Quote

renderhjs's Avatar
Old (#10)
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.
Offline , veteran polycounter, 3,037 Posts, Join Date Mar 2008, Location Sydney Australia Send a message via AIM to renderhjs Send a message via MSN to renderhjs  
   Reply With Quote

MoP's Avatar
Old (#11)
rebb: Awesome!

renderhjs: Nice overview too.
Offline , MoP, 11,603 Posts, Join Date Oct 2004, Location London, UK  
   Reply With Quote

rebb's Avatar
Old (#12)
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..
Offline , triangle, 372 Posts, Join Date Jul 2006,  
   Reply With Quote

throttlekitty's Avatar
Old (#13)
Cool beans, thanks!
Offline , polycounter, 950 Posts, Join Date Dec 2008, Location South Dakota Send a message via ICQ to throttlekitty Send a message via AIM to throttlekitty Send a message via Yahoo to throttlekitty  
   Reply With Quote

MoP's Avatar
Old (#14)
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.
Offline , MoP, 11,603 Posts, Join Date Oct 2004, Location London, UK  
   Reply With Quote

Thegodzero's Avatar
Old (#15)
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.
Brandon Nobbs, World Artist
My Portfolio
My Kickstarter
Offline , veteran polycounter, 3,267 Posts, Join Date Oct 2004, Location Kirkland WA Send a message via AIM to Thegodzero Send a message via Yahoo to Thegodzero  
   Reply With Quote

rebb's Avatar
Old (#16)
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.
Offline , triangle, 372 Posts, Join Date Jul 2006,  
   Reply With Quote

bugo's Avatar
Old (#17)
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..
Offline , dedicated polycounter, 1,463 Posts, Join Date Feb 2006, Location Redmond WA Send a message via MSN to bugo Send a message via Skype™ to bugo  
   Reply With Quote

SHEPEIRO's Avatar
Old (#18)
this is ace...i can think of many applications...cheers
senior lighting artist @ r*north
Offline , veteran polycounter, 3,423 Posts, Join Date May 2006, Location edinburgh  
   Reply With Quote

pior's Avatar
Old (#19)
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 ?
Offline , veteran polycounter, 4,949 Posts, Join Date Oct 2004, Location Irvine CA  
   Reply With Quote

MoP's Avatar
Old (#20)
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
Offline , MoP, 11,603 Posts, Join Date Oct 2004, Location London, UK  
   Reply With Quote

zxcman's Avatar
Old (#21)
What kind of profit can i get with convex&concave maps?
Offline , triangle, 379 Posts, Join Date Jun 2009,  
   Reply With Quote

divi's Avatar
Old (#22)
lots of $$$

concave map = areas where dust and dirt might settle
convexity map = exposed areas that might be damaged/worn-out more.
Offline , polycounter, 865 Posts, Join Date Jan 2009,  
   Reply With Quote

Eric Chadwick's Avatar
Old (#23)
added to the wiki
http://wiki.polycount.com/Curvature%20Map
Offline , Polycount.com Editor, 6,678 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

renderhjs's Avatar
Old (#24)
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)
Offline , veteran polycounter, 3,037 Posts, Join Date Mar 2008, Location Sydney Australia Send a message via AIM to renderhjs Send a message via MSN to renderhjs  
   Reply With Quote

bugo's Avatar
Old (#25)
Really useful as well renderhjs. Kinda easier to bake since it's a mentalray node.
Offline , dedicated polycounter, 1,463 Posts, Join Date Feb 2006, Location Redmond WA Send a message via MSN to bugo Send a message via Skype™ to bugo  
   Reply With Quote

Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 1998-2012 A. Risch