View Full Version : shaded wireframe rendering
handiklap 01-30-2006, 07:09 PM So I guess it's been long enough since we've had one of these threads. I'm trying to render a scene with isolines overlayed on top of my objects. Is there any reasonable way to do this with a 250 object scene? I've looked over the archived threads, and have tried the method where a poly object is converted to a mesh while in edge mode, so that the selection can then be inverted and all but the isoline edges can be hidden, and then a blend map is used to show those wires. The only problem is that then there are gaps in the wire at any isoline-hiddenline intersection. Is there something I'm overlooking that could easily solve this? Next I tried that method, except converted those isolines to linear splines. That looked great, but it made the scene unrenderable due to high poly counts. Does Max 8 have a new method to do so, or are we still stuck doing it in the most inefficient way possible? Or has someone written a shader they'd like to share? Or should I just start reading up on shader language?
Here's the result of the first method (which btw wasn't any more memory/processor intensive than rendering with poly objects, since they were converted to the same resolution mesh at render anyway):
http://handiklap.home.comcast.net/design22_w.jpg (http://handiklap.home.comcast.net/design22w.jpg)
and the second method after I reduced some subd iterations to bring memory usage under control; you can see where the "isolines" dip below the surface of the chair arms and the coffee cup - this was due to reducing the objects' subd iterations, while the "isolines" splines were created from a higher res mesh. Even then, you can clearly see lots of faceting from a lack of verts on the splines. (note: the lighter render poly borders were composited)
http://handiklap.home.comcast.net/design22w2_s.jpg (http://handiklap.home.comcast.net/design22w2.jpg)
I'd assume this would be a pretty simple shader to write, or at least a shader that could do the isolines that I could mix with the occlusion shader that's doing the surface shading. Any pointers on where to start learning mr shader syntax?
|
|
Hey man, there some ways to achieve what you want.
how about adding a gradient ramp to the diffuse slot. Before that, change the "Shader Basic Parameter" to face map (or crank up the U/V tiles)
In the G Ramp option choose "Box" as Gradient Type and solid as interpolation. You can also play a bit with the other options - u will get very interesting effects so play around...
Also dont forget to lower the blur...
For good quality use the global super sampler to smooth the lines.
However this will increase your render time - so be aware...
Perhaps thats a better solution and less render intensive ...
regards..
NAIK
powered by Jeff Patton
AdrianWilliams
01-30-2006, 08:36 PM
There is a Map called EdgeMap that does this for you
http://www.bytegeistsoftware.com/prod01.htm#EM
Also VRay has a good map that does this aswell as finalToon that give you a nice control of what it being renderd but that only if you got the cash to flash lol
All in all the EdgeMap works a treet and its free!:D
-Vormav-
01-30-2006, 11:17 PM
Pixel_monkey gave some very nice tips on isoline rendering using ink n' paint waaay back. Try this out:
Originally posted by PiXeL_MoNKeY
1) Convert your Geometry to editpoly (early tests with max 5/6 showed errors when using editmesh).
**2) Apply Smooth modifier to desired geometry: Autosmooth 'enable', Prevent Indirect Smoothing 'enable', Threshold '0.0'
**3) Apply Meshsmooth (or Turbosmooth): Surf Parameters: Smooth Results 'disable' (this keeps the original isolines, if enabled you will get results like the previous image).
4) Create ink'n'paint material: SmGroup 'enabled'
5) Render (for best results and quality use a raytrace renderer such as Brazil, MR, or VRay)
http://forums.cgsociety.org/showthread.php?t=179112
And I'd add one additional step to that, for your particular case: In the properties panel for the ink n' paint material, change the 'paint levels' option to 1. From there, you can just plug your regular surface shader - which can of course be your ambient occlusion - directly into the 'lighted' color shader.
Of course, if you're dealing with 250+ objects, you'd probably need to write a script to automate all of this. But if you're just working with MR, this is really the easiest way to do it. Trust me, although it might sound very simple to do an isoline shader, you would not want to try and write a shader specifically for this. When Max sends geometry to MR, it's sending over pre-subdivided geometry - meaning your shader won't have any clue where exactly the isolines are. So, in order to actually find out which edges constitute the isolines, you'd either have to work entirely with MR's subdivision surfaces (which present their own share of problems in their mr3.4 form, unless all of your geometry happens to be -perfect-), or you'd have to dig into the Max SDK to find out how to send additional sets of data to MR. Shading every edge is one thing, but even if you know very well what you're doing, writing an isoline shader would still be a hell of a task.
handiklap
01-30-2006, 11:32 PM
Thanks for the suggestions, I'll see what the ink'n'paint as well as the edgeMap. The problem with using the gradient ramp is that unless I'm applying it to uniformly sized polys, the edges end up with different thicknesses; when some surfaces don't call for a lot of resolution this presents problems, although there might be some scripting that could adjust for that. I'm pretty comfortable with maxScript so scripting for lots of objects shouldn't be a problem. Thanks again for the quick replies, I'll see how these work and post some results tomorrow.
handiklap
02-03-2006, 02:13 PM
And by "tomorrow" I meant in a few days. Thanks again:
http://handiklap.home.comcast.net/desk_s.jpg (http://handiklap.home.comcast.net/desk.jpg)
thatoneguy
02-05-2006, 06:21 AM
EDIT: Whoooops... posted in the wrong window.
handiklap: Which method did you finally use please? I use Ink'n'Paint for this purpose, but if I had lot of objects in my scene, it's pretty uncomfortable to put smooth modifier on each one. I wonder, if you could please share the script fot this?
handiklap
04-05-2006, 02:37 PM
Yeah no problem. Only requirement is that it only works on poly objects (not editPoly mod). There is a little preparation: make sure you have renderIterations on your objects set to your liking, as it uses this value as the turboSmooth:renderIterations value. Of course, the higher your poly renderIterations are, the smoother your isolines will be. The material is an ink'n'paint that uses the mentalRay occlusion shader as its base. By default, I've made the ink lines pretty thin, so you'll need to bump up your max samples to at least 16 to get a smooth line, although a smaller sample value could probably be compensated for by widening the material's ink lines. Let me know if you have any problems, as I've only used this on the desk scene and some very simplistic test scenes.
The script basically takes all poly objects in your scene, applys a Smooth mod and a Turbosmooth mod, like the method that PixelMonkey mentioned. Does a few extra tweaks to make sure you can still navigate the scene pretty easily, and includes an undo to go back to the beginning.
Shaded Isoline Convertor (http://handiklap.home.comcast.net/isoline_render.zip)
handiklap: Thanks a lot man :thumbsup: I really appreciete your help.
The script works pretty good, but it isn't perfect. You know, when I'm modeling, I'm using various modifiers and meshsmooth also. But, as you sad, this script works only on edit poly without modifiers. So I have to delete all modifiers from all of my objects in the scene manually. Maybe script could do it for me, but no problem, I can do it also :)
I should probably start learning MAXscript, because as I can see on this example, it's pretty handy thing :)
scrimski
04-05-2006, 07:07 PM
Use the material in my signature.
scrimski: Thanks, but the material in your signature doesn't render isolines and that is what i'm going after :)
CGTalk Moderation
04-05-2006, 08:04 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.