libs/yocto/yocto_scene.cpp
// Eval material to obtain emission, brdf and opacity.
Eval material to obtain emission, brdf and opacity.
Eval material to obtain emission brdf and opacity .
float eval_opacity(const scene_instance* instance, int element, const vec2f& uv,
    const vec3f& normal, const vec3f& outgoing) {
  auto material = instance->material;
  auto texcoord = eval_texcoord(instance, element, uv);
  auto opacity  = material->opacity *
                 eval_texture(material->opacity_tex, texcoord, true).x;
  if (opacity > 0.999f) opacity = 1;
  return opacity;
}
float eval_opacity ( const scene_instance * instance , int element , const vec2f & uv , const vec3f & normal , const vec3f & outgoing ) { auto material = instance -> material ; auto texcoord = eval_texcoord ( instance , element , uv ) ; auto opacity = material -> opacity * eval_texture ( material -> opacity_tex , texcoord , true ) . x ; if ( opacity > 0.999f ) opacity = 1 ; return opacity ; }
Eval material to obtain emission, brdf and opacity.
Eval material to obtain emission brdf and opacity .