Glossy reflections/refractions

   6204   7   1
User Avatar
Member
175 posts
Joined: July 2005
Offline
Is there any affordable way to achieve gloss/frost effect in mantra?
User Avatar
Member
941 posts
Joined: July 2005
Offline
peliosis
Is there any affordable way to achieve gloss/frost effect in mantra?
Unless I misunderstand the question, glossy reflections are simply blurred reflections (ditto for refraction). Both the reflectlight() and refractlight() VEX functions support multiple samples over some solid angle, so yes, there's support for such a thing in Mantra. These functions are also available as VOPs: “Reflected Light” and “Refracted Light”.

Is this what you're looking for?
Mario Marengo
Senior Developer at Folks VFX [folksvfx.com] in Toronto, Canada.
User Avatar
Member
175 posts
Joined: July 2005
Offline
Blind servant bows in awe

Thanks Mario
User Avatar
Member
1631 posts
Joined: July 2005
Offline
The VEX Metal Shader has a “Samples” or “Blur” parameter which demostrates the effect.

Cheers!
steven
User Avatar
Member
12507 posts
Joined: July 2005
Offline
Hey Peliosis,

Here is a snippet from the Renderman book; their “glossy specular” funtion ported over to work in VEX - if you are interested in dabbling in shading language.

This creates a circlular specular like what you'd see on a cue ball.


#include <shading.h>
#include <prman.h>

/*
* LocIllumGlossy - a possible replacement for specular(), with a
* more uniformly bright core and a sharper falloff. It's a nice
* specular function to use for something made of glass or liquid.
* Inputs:
* roughness - related to the size of the highlight, larger is bigger
* sharpness - 1 is infinitely sharp, 0 is very dull
*/
color LocIllumGlossy ( normal nn; vector V;
float roughness; float sharpness; )
{
vector C = 0;
float w = .18 * (1-sharpness);
vector H;

illuminance (P, nn, PI/2, LIGHT_SPECULAR) {
H = normalize(normalize(L)+V);
C += Cl * smoothstep (.72-w, .72+w, pow(max(0,dot(nn,H)), 1/roughness));
}
return C;
}
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
12507 posts
Joined: July 2005
Offline
Well, I seemed to answer without properly reading your post. Anywayyyyyy…
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
175 posts
Joined: July 2005
Offline
Thanks Jason!

My question was a bit more basic
I'm on my motorway to learn vex. I'm browsing a few books on rman in my free time just to gain some firmer background. Most of the rsl shaders look short and clear, and there are so many examples around. I need the skill to translate them vex, it seem to solve many of my problems.
User Avatar
Member
23 posts
Joined: July 2005
Offline
stevenong
The VEX Metal Shader has a “Samples” or “Blur” parameter which demostrates the effect.

Cheers!
steven


hi everyone,
how to recreate that particular result in VOP by using the reflectlight() and refractlight() VEX functions ?

Is there any example file to dig?

thanks.
jordan
http://pixel-samurai.blogspot.com/ [pixel-samurai.blogspot.com]
  • Quick Links