VEX shading functions
Houdini/VEX functions 2012. 12. 13. 02:00 |Sign VEX node
smooth VEX function
smoothstep(min,max,x) : x가 [min, max] 사이의 값인 경우에 대해서 [0, 1] 사이에서 부드럽게 변하는
Hermite 보간법을 리턴한다. x가 min보다 작다면 0을 리턴하고, max보다 크다면 1을 리턴한다.
lerp VEX function
diffuse VEX function
Returns the diffuse (Lambertian) illumination given the normalized surface normal.
vector diffuse(vector nml)
vector diffuse(vector nml, vector V, float roughness)
bsdf diffuse()
bsdf diffuse(vector nml)
See writing a PBR shader for information on BSDFs.
Returns the diffuse (Lambertian) illumination given the normalized surface normal.
The diffuse(vector nml, V; float roughness, ...)
form uses the
Oren-Nayar lighting model to compute the diffuse illumination for the
surface. The Oren-Nayar lighting model is a more sophisticated lighting
model than Lambertian lighting. The V vector represents a vector from
the surface to the eye (i.e. -normalize(I)). With a roughness of 0, the
Oren-Nayar lighting model is equivalent to the Lambertian model. As
roughness increases toward 1, the illumination changes to mimic rougher
materials (like clay). The Oren-Nayar form of diffuse() is more
expensive than Lambertian diffuse lighting.
ambient VEX function
Returns the color of ambient light in the scene.
vector ambient()
Returns the color of ambient light in the scene.
You can optionally specify a light mask.
specular VEX function
phong, blinn, and specular return the illumination for specular highlights using different lighting models.
vector specular(vector nml, vector V, float roughness)
bsdf specular(vector dir)
See phong for information on the basic lighting models. See writing a PBR shader for information on BSDFs.
You can optionally specify a light mask.
reflect VEX function
Returns the vector representing the reflection of the direction against the normal.
vector reflect(vector direction, vector normal)
Returns the vector representing the reflection of the direction
against the normal.
refract VEX function
Returns the refraction ray given an incoming direction, the normalized normal and an index of refraction.
vector refract(vector direction, vector normal, float index)
Returns the refraction ray given an incoming direction, the normalized normal and an index of refraction.
The index is a relative index of refraction, the ratio between the interior and exterior index of refraction, where the exterior is defined by the direction of the normals (normals point away from the interior).
In the case of total internal reflection, this function returns the reflection vector.
For example:
refract(normalize(I), normalize(N), outside_to_inside_ior)
frontface VEX function
If dot(I, Nref) is less than zero, N will be negated.
vector frontface(vector N, vector I)
This form (which doesn’t take a reference vector) is only available in the shading contexts, where the Ng variable is used.
vector frontface(vector N, vector I, vector Nref)
'Houdini > VEX functions' 카테고리의 다른 글
VEX Functions Definition (0) | 2013.01.18 |
---|---|
VEX functions (0) | 2012.11.18 |