Glossy reflections/refractions
6452 7 1- peliosis
- Member
- 175 posts
- Joined: July 2005
- Offline
- Mario Marengo
- Member
- 941 posts
- Joined: July 2005
- Offline
peliosisUnless 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 there any affordable way to achieve gloss/frost effect in mantra?
Is this what you're looking for?
- peliosis
- Member
- 175 posts
- Joined: July 2005
- Offline
- stevenong
- Member
- 1634 posts
- Joined: July 2005
- Offline
- jason_iversen
- Member
- 12669 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;
}
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]
also, http://www.odforce.net [www.odforce.net]
- jason_iversen
- Member
- 12669 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]
also, http://www.odforce.net [www.odforce.net]
- peliosis
- 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.
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.
- jeonado
- Member
- 23 posts
- Joined: July 2005
- Offline
-
- Quick Links