Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography



Maxunderground news unavailable

I want to make a "Normal-map-like" material set to world space/custom axis.
show user profile  Stenrik
Hi,

Forgive me if this is a noob question, but I AM a noob to Max materials, and wasn't able to google this.

I am rendering elements of a scene that I intend to bring into Photoshop. I would then use channels to create layers based on the angle of the model's faces.

Like this:

So I need to be able to color all polygons of my objects based on where they're facing in the world.

For example...
Blue: All polygons completely perpendicular with the Z axis (facing into the sky or ground) would be pure blue.
Red: Same, except for red on the X axis.
Green: Same, except for green on the Y axis.

All polygons facing partially up or down would be a color blend.
(Ideally, I'd be able to customize the direction of colors, so that pure red is facing between X and Y somewhere, but I could just rotate the entire scene as a workaround.)


The closest I've been able to get with this is the "Falloff" map, applied to a standard material. I can set it to world space and select 2 colors. However, this limits me to 2 colors, and I really need 3 to do what I'm trying to do properly.

I tried applying the "normal" map in the same fashion, but I know that's the wrong one to use since it needs, well, a MAP. Not the right thing. All I know is that I'm trying to do something similar in principle to how normal maps are generated.


The obvious suggestion would be to set up different colored lights from the proper directions, turn off all cast/object shadows and render away. However, my scene is devoid of all light sources. I want to stick to a self illumination map with an RGP tint on each of the 3 colors, which I'm currently doing with single color wireframe renders. It's important that I have no shadows on the objects themselves.

On top of that, using light sources would be very tedious, since I want to apply this "normal-like" map to each object separately, and it's a complex scene. I'd have to make exclusive lights for each object, no shadows, facing the right relative angle AND distance. Unless there's a macro to do this to every object quickly, I want to avoid that approach.


Any guidance on this would be very helpful. It seems like there must be a way to do this, obvious or not. Thanks!
read 838 times
12/21/2014 7:30:07 AM (last edit: 12/21/2014 7:30:38 AM)
show user profile  herfst1

read 830 times
12/21/2014 9:28:58 AM (last edit: 12/21/2014 9:28:58 AM)
show user profile  reeves1984
>The closest I've been able to get with this is the "Falloff" map, applied to a standard material. I can set it to world space and select 2 colors. However, this limits me to 2 colors, and I really need 3 to do what I'm trying to do properly.

If you can do that, can you not just make a couple of those falloff maps with each colour channel you want, add them together and then you have a normals-like render?

I could do this in a glsl shader actually.... What renderer are you using?


ps. You said perpendicular with the z axis, but that would be normals that are at a right angle to the axis, you meant faces parallel to the axis I think

--
Simon Reeves


www.simonreeves.com - VFX Artist & Blog
twitter


www.analogstudio.co.uk <-- I work here

read 813 times
12/21/2014 5:02:14 PM (last edit: 12/21/2014 5:02:14 PM)
show user profile  Stenrik
@herfst1: Thanks for the tutorial! I'd been hoping to avoid using the projection method only because I have a very large scene with a ton of objects, and thought I heard that quickly slows down with complex projections. I also couldn't find the script used in method 2.

@reeves1984: This does work somewhat, but it's "symmetrical" - for example, blue is projected on both the left and right of the model, whereas in a "pure" normal projection, blue is only on one side. Maybe I'm just doing it wrong, heh.

However, I did stumble upon one way that does what I was trying to do in one swoop, (though not faceted), by creating a mental ray material, adding the Ambient/Reflective Occlusion map to the Surface slot, and then setting Type to Bent Normals (Camera/World).

Also thanks for correcting my slipup, I indeed meant faces parallel to the axis. :)
read 784 times
12/22/2014 3:39:03 AM (last edit: 12/22/2014 3:40:33 AM)
show user profile  reeves1984
Actually I take it back! :) You were right, if you were thinking the face is like this _ and the axis is like this |
whereas I was thinking of axis | and poly nomal |


Oh ok yeah I see what you mean about fall offs then - I want to try and do the glsl thing as a test for me lets see...


--
Simon Reeves


www.simonreeves.com - VFX Artist & Blog
twitter


www.analogstudio.co.uk <-- I work here

read 773 times
12/22/2014 11:17:48 AM (last edit: 12/22/2014 11:17:48 AM)
show user profile  K-tonne
are you just trying to find which direction things are facing to help texturing?

4 direct lights of differing colours outside the scene would do it- but you'd still have to unwrap everything to bake the projected colours to the diffuse

Website and Portfolio

read 756 times
12/22/2014 3:18:08 PM (last edit: 12/22/2014 3:18:08 PM)
show user profile  BishBashRoss
I just knocked something up using falloff maps set to 'towards away' and a composite map. Seems to work fine.

Also what about a normals pass?







read 751 times
12/22/2014 3:52:59 PM (last edit: 12/22/2014 3:52:59 PM)
show user profile  reeves1984
Is this right...
-- Simon Reeves www.simonreeves.com - VFX Artist & Blog twitter www.analogstudio.co.uk <-- I work here
read 744 times
12/22/2014 4:51:49 PM (last edit: 12/22/2014 4:56:31 PM)
show user profile  BishBashRoss
"The closest I've been able to get with this is the "Falloff" map, applied to a standard material. I can set it to world space and select 2 colors. However, this limits me to 2 colors, and I really need 3 to do what I'm trying to do properly. "


I'm pretty confused by this thread at the moment but you can get 3 colours in a falloff map by plugging it into a gradient ramp set to mapped.





read 735 times
12/22/2014 5:24:31 PM (last edit: 12/22/2014 5:24:31 PM)
show user profile  9krausec
Reeves- Where's your sRGB button on your VFB? Also when you export to a 32 bit float do you find that your normals pass is usually washed out and needs a bump of contrast/gamma correction in post?

Sorry for the little addition to this thread. It just felt right.




- Portfolio-




read 719 times
12/23/2014 1:18:49 AM (last edit: 12/23/2014 1:18:49 AM)
show user profile  reeves1984
Its the curve icon next to LUT now in VRay 3
http://docs.chaosgroup.com/display/VRAY3/V-Ray+Frame+Buffer#V-RayFrameBuffer-VFBToolbar

I dont tend to render full float/32bit but how are you viewing it?

It should be saved out linear (as it looks in my images) and only VIEWED with sRGB, while the processing happens in linear.
Either you've baked in sRGB curve or you're viewing it like that. Nuke handles the colours space stuff well.

--
Simon Reeves


www.simonreeves.com - VFX Artist & Blog
twitter


www.analogstudio.co.uk <-- I work here

read 702 times
12/23/2014 1:33:20 PM (last edit: 12/23/2014 1:33:20 PM)
show user profile  9krausec
I'm exporting as 32 bit float exr and my normals have always came out with the normal gamma baked so that it is washed out. I must be doing something wrong. :D

First step to correcting a problem is admitting there is one. I'll have a go this weekend at getting to the bottom of it so expect me to post more in this thread.

Thanks for the reply.




- Portfolio-




read 698 times
12/23/2014 2:15:14 PM (last edit: 12/23/2014 2:15:14 PM)
#Maxforums IRC
Open chat window


Support Maxforums.org