PDA

View Full Version : NPR For Maya: first lil tidbit released


playmesumch00ns
03-25-2003, 09:07 PM
OK it's not the first alpha release I'm afraid, but the first little bit of it, nprShader is up on Highend3d: http://www.highend3d.com/maya/plugins/?group=mayaplugins&section=rendering#2230

Basically I got bored of what I was doing today and decided to have a go at implementing this. It's based on the paper "A Painterly Approach To Human Skin" by Matt Kaplan. The same technique has also been implemented by Worley Labs in the Art Mode of their G2 plugin for Lightwave. There's a very good description of what it does at their site (http://www.worley.com/G2/g2_artmode.html) .

Essentially you paint a sphere to determine the shading for you object. Download it and try it out! Please let me know of any bugs, features you'd like to see etc... If you make anything nice with it please send me a picture!!

Oh, I should add this is like version 0.000001 as such it's not perfect. Basically it needs a proper UI control for selecting the shading map, but I'm not digging around in AE shader templates just yet!! (unless anyone would like to tell me how...). It also needs methods for loading other files apart from targas, and some filtering wouldn't go amiss. Also I'm not sure if it will shadow correctly or even at all. Let me know! I'll be sorting all these issues out soon so check for updates!

Have fun!

beaker
03-25-2003, 09:36 PM
In the future are you going to compile it for other operating systems? or are you using win32 specific code?

playmesumch00ns
03-25-2003, 09:44 PM
I've only got access to windows, but if anyone else fancies compiling it for irix/linux/osx I'd be more than happy to send them the source code. This shader should compile without trouble on other OSes:)

Houkah
03-25-2003, 09:55 PM
I keep getting an error: The specified module could not be found. When i try to turn it on in the plug-in manager. I placed the nprshader.mll into my c:\program files\aliaswavefront\maya4.5\bin\plug-ins

any ideas?

playmesumch00ns
03-25-2003, 10:30 PM
May have done somthing wrong with the includes. Works fine here... I've recompiled it to make sure. I know that the 4.0 version works fine on other machines, but now I'm away from a copy of 4.5 I'm afraid. I've uploaded the recompiled files. Can you let me know if it works?

altruizine
03-26-2003, 12:04 AM
I've got OS X and Maya 4.5 - and a weee wee bit o' programming background. What would be involved in the compile?

-JF

playmesumch00ns
03-26-2003, 12:08 AM
Don't know about the specifics of compiling under OSX but no code changes should be required. It should just be a case of running it through a compiler. Fancy having a go?

altruizine
03-26-2003, 03:00 AM
well, I'll give it a shot - I'll leave my email for you in a private message. Contact me from there.

Thanks! Should be fun!

-JF

Sammy
03-26-2003, 03:32 AM
Anders,

Happy to see you've got a public compile ready for us !!

Unfortunately, I'm having the same problem with it running under 4.5 as Houkah reported ...

Exciting developments with your test render! Keep on Rockin!

:beer:,
Sammy
rhibit@lilypad.ca
-+-

Houkah
03-26-2003, 05:35 AM
Just tried your new compile here at home and i get the same error message. I tried defining new system variables for script and plug-in paths also and I still get the same message.

playmesumch00ns
03-26-2003, 09:43 AM
Arrrgh!! Sorry guys! I just threw a quick compile together on a friend's machine for the 4.5 - we've only got 4.0 here at university.

The "specified module could not be found" error message happens when it can't find a DLL.

Really sorry guys. I'll try and see my friend to day. I'll get this sorted as soon as possible.

*red cheeks*:hmm:

playmesumch00ns
03-26-2003, 12:18 PM
Egg on my face. Forgot to include a DLL in the package. I've uploaded the complete package to highend3D so should work fine now!


http://www.highend3d.com/maya/plugins/?section=rendering#2230

solun
03-26-2003, 02:26 PM
The "specified module could not be found" error message still showed with the new version.

Keep going!


Thx


:shrug: :drool:

playmesumch00ns
03-26-2003, 02:42 PM
Okay added a couple more DLLs to the package. It's weird, seems whenever someone tests it out there's more missing, just when I think I've got it fixed. Tested the last uploaded package on a friends machine and it worked fine!!

Can you let me know if this one works for you?

Thanks

Houkah
03-26-2003, 02:57 PM
Works now. Thanks for the sneak peak at your NPR plugin ch00ns. I have yet to make anything interesting w/ it since i'm at work and only have models of books here.

playmesumch00ns
03-26-2003, 02:59 PM
Sweet merciful lord thankyoU!!! about bloody time!! Don't forget if you guys make any interesting piccies or shading maps, please let me have a copy!! Enjoy! (finally):scream:

solun
03-26-2003, 03:46 PM
It work!!!

:thumbsup: :beer:

steveblake
03-26-2003, 04:10 PM
Sounds great!

Can you guys post up any qsamples / renders for us unfortunates, who haven't had a chance to give it a go??

Cheers!

Houkah
03-26-2003, 07:00 PM
Ok i played around a little at work. Didn't have any good models to use it on so i just made a quick dummy head (really crappy looking). Anyway all i did was change the .tga file w/ filters in photoshop to conserve time (instead of painting it by hand)

http://www.mikechung.com/images/testface.jpg
http://www.mikechung.com/images/testcutout.jpg
http://www.mikechung.com/images/testpaint.jpg

well hopefully that worked.

/edit - So far this is shaping up really nicely ch00ns. This lil preview is really easy to use. I should say, i messed around w/ IPR and moved around my lightsources and the texture updated to accomodate the move in lights. Nice :thumbsup:

playmesumch00ns
03-26-2003, 07:12 PM
Excellent Houkah! Thanks mate that's exactly what I wanted. Love the look you've got on the last one especially!:thumbsup: :beer:

Methinks from looking at the images I really need to add some filtering to stop the aliasing that's particularly evident on the jawbone in the first two pics.:wip:

I think the look of the shader can be vastly improved by using a higher-res shading map, but I haven't had time to paint one yet! I think when I fancy 5 minutes off later tonight I might have a crack at doing a couple in Painter. Right now I'm deep in UI-building for NPR, and it's doing my head in!:scream:

Houkah
03-26-2003, 07:26 PM
ahhh so the resolution doesn't matter? I could make a 2k x 2k sphere and it would work exactly the same? Could get some really nice brush details then. So are you making this NPR plugin just for fun?

playmesumch00ns
03-26-2003, 07:29 PM
Yes the higher the resolution the better!

I suppose I'd say I'm doing this for fun: it's actually my major project at university, but I chose to do this because it interests me. Didn't realise just how much hard work it was all going to be when I started tho...:surprised

solun
03-27-2003, 01:19 AM
a test


Very nice.





How many light can it be worked with? It only can worked with on light in the test.

solun
03-27-2003, 01:20 AM
:buttrock: :thumbsup:

jschleifer
03-27-2003, 05:19 AM
How's the work going on the OS-X port? I'd love to give it a shot as well.. been trying to figure out how to get an NPR look and this seems pretty interesting.. :)

-jas

altruizine
03-27-2003, 05:28 AM
cheesy starstruckness: on

Jason Schleifer! Ah man! love your work, love your work...

cheesy starstruckness: off

I ran a very quick first pass at the OS X compile this evening - didn't have much time (aargh work) but could get the linking to work.

I read in another thread you were also compiling some plugs for OS X.... would it be possible to maybe give me some pointers as to setting up Project Builder for this sort of thing correctly? I'm having trouble just getting it to find the needed headers... it's been a while and I'm not wholly familiar w/ PB.

I'd really like to get up to speed w/ this sort of thing because I think the more of us out there willing to compile plugs for Maya OS X, the better...

Tomorrow should yield more time for this...

-JF

jschleifer
03-27-2003, 05:35 AM
altruizine.. sounds like we're kindered spirits!

I've got tons of experience programming in scripting languages (mel, perl, etc), but only a tiiiny bit in C++, C, etc (after all, I"m just an animator. :) So I'm right in the middle of trying to figure out how to compile plugins for Maya in OS-X.. sounds like we could pool resources and try and get a working build environment. :)

Are you using just the standard developer's kit that comes with OS-X or do you have codeWarrior? I remember reading in the Maya Docs somewhere that they recommend code warrior, but I kinda figure that you don't "really" need it.. you just need to know where all the header files are and make sure you include them.. then as long you've got the c++ compiler working & the libraries pointed to correctly, then you should be good to go.. yeah?

cheers!
-jason

altruizine
03-27-2003, 05:54 AM
Kindred indeed! Gotta keep the OS X users happy - need more toys!

There was a time when I could bang out C and C++ pretty damn well - then I switch to a film production major, the years have gone by and haven't been kind to my knowlege of C, C++, Perl or Java... but there was a time, and I've got my books, so I shoud be okay.. :)

I've started in with mel and that's been getting more and more attention as I'm working - it just makes a lot of stuff easier sometimes.

So, yeah, I'd really like to get a build env. going for OS X and try to get a few of these shaders over.

I don't have Code Warrior and it looks like the sample projects are built with that. I've got the Apple dev kit installed and am trying to wrangle that to work but I'm just not that familiar w/ it. I've got a friend who's doing a good deal of work with it and he's going to try to help me out. I'll definately keep you as informed as I become on this...

Work tomorrow, class tomorrow night, then I'm full bore on this (maybe I'll sneak some readin in over lunch)...

so, yeah. good to go! :)

-Jeremy

somlor
03-27-2003, 09:14 AM
Pretty cool, playmesumch00ns! :thumbsup:

http://www.seanomlor.com/images/forum/lotrNPR.jpg

[s]

steveblake
03-27-2003, 09:31 AM
nice render somlor! Anyone tried these with an animated sequence?

As a matter of interest I just found this on spiraloid


http://www.mrl.nyu.edu/projects/npr/images/npr-teaser.jpg
NPR research (http://www.mrl.nyu.edu/projects/image-analogies/lf/)

Seems to be 2D filter of sorts...

jschleifer
03-27-2003, 10:01 AM
This is the style of render I'm trying to achieve.. do you think this is possible with this type of NPR render?

cheers!
-jason

steveblake
03-27-2003, 10:21 AM
An alternative to playmesumch00ns funky work, might be the Tomcat shader on highend3d/maya/pluging/paintfx

Seems to do nice swanky outlines...

http://spyral.free.fr/toonshade/bouncingBall/paint.gif

anyway here's some more NPR links (http://www.red3d.com/cwr/npr/#painterlyrender)

jschleifer
03-27-2003, 10:35 AM
yeah, I'd LOVE to get the tomcat render.. but he's not doing it for OS-X, and that's what I'm trying to base my project on.. d'oh! :)

playmesumch00ns
03-27-2003, 01:02 PM
Solun, Somlor: Thanks guys, awesome work, the shader looks great on your models!!:beer:

Solun: Yes it only works with the first light in the scene (or rather the first diffuse light). It just uses the position of the light to colour the object. I've been considering how it might look with more lights, and how to make that work. Maybe something to tackle next time the renderer's giving me a headache!

Somlor, do you think you could send me a copy of the shading map you used in the picture you posted?:thumbsup:

steveblake: I've read that paper by Hertzmann (one of the big daddies in NPR), actually I've read pretty much everything! Actually it was partly that paper that gave me the inspiration for NPR for Maya! Patrick (the guy who's writing Tomcat) has raised the idea of a possible collaboration, but don't know any more than that at the moment.

Jason: dude! I'll send you a copy of the source for the shader, then perhaps you and alturizine can get an OSX version going! Hopefully there should be a linux compile sometime soon too!
As far as that look you want to achieve Jason, I can say my renderer can definitely produce that quite easily.

The chances of an OSX port I think are pretty good. As I'm getting further into it, I'm now starting to rely more and more on these pixel buffers for doing visibility testing (as Maya's depth buffer is a ****ing nightmare). I had hoped that maybe I could do this in software, but I won't have time now (maybe this could be something I could tackle after my university hand-in). Anyway, possibilities are this: If you can find someone who knows about OpenGL on OSX then I think it's perfectly possible. Actually I know a couple of places to start looking! It would basically just be a case of switching a class around in the header file for an OSX-version, and if someone could write that class for me (just needs to define a pixel buffer in video memory, and open up an invisible window in the case of batch rendering), then it should just be a case of doing a #ifdef __WIN32 to swap the code around.

All I can say is I'd really like to get a version together that you could use. I have submit some good visual stuff as part of my hand-in, I don't have to make them, I just have to be able to demonstrate that my plug-in is capable, so showing (properly accredited of course) work by others is fine!


I'm really happy everyone's making such nice pictures with this already! I only started developing this shader as a way to get nice painterly colours on the object for the brush-strokes in my renderer to pick up on, from the results I've seen so far, it looks like it's standing up pretty well on it's own! Great work guys, keep the pictures coming!:bounce: :beer:

Sammy
03-27-2003, 06:21 PM
hey ch00ns,

I played around with your NPR for a little while. I'd like to make a request if possible. It would really help if you could somehow publish a file OUTLINING the precise REGIONS your plugin scans on the TGA source file for it's values ... it would be of great value in creating new experiments!

Find attached some ruff tests ... I'm trying to match the highlights of my default blinn to the NPR with mixed results. Lots of back and forth adding lighter areas to get the desired effect.

I was happy to see that your plugin is compatible with the TomCat toonshader -- they work pretty well together. I'll keep running them through their paces to see if something explodes.

http://www.lilypad.ca/npr_test1.jpg
http://www.lilypad.ca/npr_test2.jpg
http://www.lilypad.ca/npr_test2b.jpg

:beer:,
Sammy
rhibit@lilypad.ca
-+-

playmesumch00ns
03-27-2003, 07:26 PM
Sammy: Here's a quick explanation of how it works:

Open up the attached diagram in a seperate window, the points below apply to the numbered pictures.

1. Here we've got a surface being lit by a single lightsource (in green).

2. If we're shading the point, P, we can define a vector, L, which points straight at the lightsource.

3. If you think about it, wherever the lightsource is, if we make the length of L one, then from P's point of view the light is somewhere on a unit hemisphere. So we can define the colour that P should adopt by colouring in this hemisphere and telling P to adopt the colour of the point that L points to.

4. Alternatively we can just paint a flat shading map, and look straight down at P in the direction of the surface normal, et voila, L now points at a particular pixel in the shading map.

Therefore if you make a radial gradient shading map in Photoshop going from say white to black, you will get normal lambert shading.

Hope this helps!

altruizine
03-27-2003, 07:51 PM
ch00ns,

I've got a friend who's been doing a bit of ogl coding in OS X... could you email me a description of what you need? I'll forward it to him and see if he knows what's needed..


-Jeremy

playmesumch00ns
03-27-2003, 09:02 PM
Just uploaded version 0.2 to highend3D. Now has support for multiple lights and light colours (Maya 4.5 only). Doesn't really fit in with the philosophy of the shader, but I thought what the hell. I tried to do it in a way that fitted better first off but it ended up looking pants, so standard lighting techniques now. Anyway, results should be what you expect.

Also there's a hidden attribute, ".translucenceCoeff" which you can use to change the amount of light that hits the back faces (between 0 and 1). Haven't fully implemented this yet, that's why it's hidden as it gives slightly funky results still.

Sammy
03-27-2003, 10:15 PM
ch00ns,

paradigm shift buddy! thanks !!

:beer:,
Sammy
rhibit@lilypad.ca
-+-

somlor
03-27-2003, 10:46 PM
Here is a lower res JPG of the shading map I used which was a 1000x1000 Targa on my model:
http://www.seanomlor.com/images/forum/nprShaderSmall.jpg

PM me your email and I'll send you the 1000x1000 map if you want.

:beer:

Sean.

solun
03-28-2003, 03:04 AM
It's a Animation test.


I think that is too smooth for I in this animation test,
If it can be use with a sequence of file in the shade, it may be more better.


http://www.geocities.com/solun888/Anitest.avi (www.geocities.com/solun888/Anitest.avi)

playmesumch00ns
03-28-2003, 03:11 AM
Nice test solun, thanks!

I agree it does look a bit smooth, that's because it's essentially doing environment mapping which is why it looks a bit chromey I think.

Loading an image sequence could be a great idea! Somthing to put on the to-do list for version 0.3!:)

Milho
09-12-2003, 01:32 PM
Originally posted by playmesumch00ns
Sammy: Here's a quick explanation of how it works:
...
...


Wowie that's an awesome idea! I'd loved to see a linux version of the plug!

Jason: Did you allready do this style of the dog in maya or is it a painted pic? Only thing that comes to my mind with this kind of strokes is jot http://jot.cs.princeton.edu/index.php
Facial also does some incredible things with maya http://www.cgtalk.com/showthread.php?s=&threadid=20613/

jschleifer
09-12-2003, 11:35 PM
wow.. jot looks great! has anyone tried it yet?

Milho, the dog is a maya render.. I talk about it a bit at http://jonhandhisdog.com but more will come of it soon. :)

-jason

Milho
09-13-2003, 01:25 AM
Not yet. I only heard that it rocks (if it doesn't crash). Try searching for jot and/or npr in cgtalk, you wouldn't believe what treasures you can find

For you as a maya user it might be good to hear that I'm working on a Maya to Jot Exporter in MEL. Nothing big a simple ASCII Format, I bet you could write something like this in between animating gollums left toe and your coffee break ;)

I hope the Princeton fellows will release a linux version soon as they promised in the documentation. To be honest I haven't toched my win2k boot option since the thing with the viruses/worms :surprised
But trying out Jot would be a good reason to update my M$WinCrap.

BTW: I'm really suprised that you go with macs. Must be because I used mac os 9.2 at work the last 4 months and it sucks alot. would use a worse word than suck but then tito or leo would kick my a....aehm. Well I guess osx changed alot. I love the x in its name which reminds me that it is partly based on linux.
BTW2: hey you know a lot of guys at alias don't u? please make them change the windows manager from motif to something like gtk. motif is so ugly. it is not fun to work with maya at linux...but faaaast ;)
BTW3: ok I wrote more than I planed to write again. at least I don't bother you with these anymore :bowdown:

CGTalk Moderation
01-14-2006, 05:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.