BSDF Shaders

This commit is contained in:
2026-07-24 17:02:00 -07:00
parent b77aca926a
commit ddc12e8607
5 changed files with 334 additions and 62 deletions

View File

@ -99,6 +99,21 @@ class ParserState:
self.out_opacity: floatstr = '1.0'
self.out_ior: floatstr = '1.450'
self.out_emission_col: vec3str = 'vec3(0.0)'
self.out_subsurface: floatstr = '0.0'
self.out_subsurface_radius: vec3str = 'vec3(0.0)'
self.out_subsurface_color: vec3str = 'vec3(0.8)'
self.out_specular_tint: vec3str = 'vec3(1.0)'
self.out_anisotropy: floatstr = '0.0'
self.out_aniso_rot: floatstr = '0.0'
self.out_sheen: floatstr = '0.0'
self.out_sheen_rough: floatstr = '0.5'
self.out_sheen_tint: vec3str = 'vec3(1.0)'
self.out_clearcoat: floatstr = '0.0'
self.out_clearcoat_rough: floatstr = '0.03'
self.out_transmission: floatstr = '0.0'
self.out_transmission_rough: floatstr = '0.0'
self.out_thin_wall: floatstr = '0.0'
self.out_tangent: vec3str = 'vec3(0.0)'
def reset_outs(self):
"""Reset the shader output values to their default values."""
@ -110,11 +125,34 @@ class ParserState:
self.out_opacity = '1.0'
self.out_ior = '1.450'
self.out_emission_col = 'vec3(0.0)'
self.out_subsurface = '0.0'
self.out_subsurface_radius = 'vec3(0.0)'
self.out_subsurface_color = 'vec3(0.8)'
self.out_specular_tint = 'vec3(1.0)'
self.out_anisotropy = '0.0'
self.out_aniso_rot = '0.0'
self.out_sheen = '0.0'
self.out_sheen_rough = '0.5'
self.out_sheen_tint = 'vec3(1.0)'
self.out_clearcoat = '0.0'
self.out_clearcoat_rough = '0.03'
self.out_transmission = '0.0'
self.out_transmission_rough = '0.0'
self.out_thin_wall = '0.0'
self.out_tangent = 'vec3(0.0)'
def get_outs(self) -> Tuple[vec3str, floatstr, floatstr, floatstr, floatstr, floatstr, floatstr, vec3str]:
def get_outs(self) -> Tuple:
"""Return the shader output values as a tuple."""
return (self.out_basecol, self.out_roughness, self.out_metallic, self.out_occlusion, self.out_specular,
self.out_opacity, self.out_ior, self.out_emission_col)
return (self.out_basecol, self.out_roughness, self.out_metallic,
self.out_occlusion, self.out_specular, self.out_opacity,
self.out_ior, self.out_emission_col,
self.out_subsurface, self.out_subsurface_radius,
self.out_subsurface_color, self.out_specular_tint,
self.out_anisotropy, self.out_aniso_rot,
self.out_sheen, self.out_sheen_rough, self.out_sheen_tint,
self.out_clearcoat, self.out_clearcoat_rough,
self.out_transmission, self.out_transmission_rough,
self.out_thin_wall, self.out_tangent)
def get_parser_pass_suffix(self) -> str: