Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: phildavis17 on 2016-02-09, 23:10:20

Title: Generating a Procedural Normal Map
Post by: phildavis17 on 2016-02-09, 23:10:20
Hello,

When I need to render a material with a subtle sparkle, I do it by using the technique described in the Corona Car Paint tutorial embedded below. I rendered out a normal map using a plane and some rotated scatter objects.

I was wondering, though, if it is possible to generate a procedural version of this kind of normal map. Generating a random RGB value is easy enough, but I'm not sure how to generate an RGB value that is within the specific color domain of a normal map. I have been working on it a little, but I haven't gotten a good result. My vector math is pretty rusty and I have never tried to do anything so precise in the Max Material editor before, so I thought I'd ask for some guidance.

How would you do it?

Title: Re: Generating a Procedural Normal Map
Post by: Ondra on 2016-02-09, 23:46:26
if you know math, it is really easy:

1) have a surface. Rotate it so its geometry normal points UP in Z direction (its geometry normal is 0 0 1)
2) take your shading normal on this rotated object (which is 0 0 1 if there is no deviation, or something else if there is some deviation, but it will always have positive Z component)
3) take the 3 numbers of your shading normal, divide divide them by 2, and add 0.5
4) write those 3 numbers as RGB into the normal map
Title: Re: Generating a Procedural Normal Map
Post by: arqrenderz on 2016-02-10, 02:53:48
Lool didnt understand a single thing :P
Title: Re: Generating a Procedural Normal Map
Post by: Juraj on 2016-02-10, 03:05:27
Lool didnt understand a single thing :P

yeah :- D what we need is those pretty stochastic speckles Vray implemented in 3.3.
Title: Re: Generating a Procedural Normal Map
Post by: romullus on 2016-02-10, 09:42:54
I think this topic might be a good place to ask: Ondra, do you have plans to bring OSL support into Corona and if so, do you have a rough estimate when that might happen?
Title: Re: Generating a Procedural Normal Map
Post by: Ondra on 2016-02-10, 14:23:35
I think this topic might be a good place to ask: Ondra, do you have plans to bring OSL support into Corona and if so, do you have a rough estimate when that might happen?
this is from the "doable, but not currently scheduled" bucket
Title: Re: Generating a Procedural Normal Map
Post by: maru on 2016-02-10, 14:27:25
My (pretty lame) attempt:
Title: Re: Generating a Procedural Normal Map
Post by: romullus on 2016-02-10, 14:36:46
this is from the "doable, but not currently scheduled" bucket
At least it's not rulled out completely. Thank you!