78 float3 base_color = mat_data.rgb;
81 if (srt.consts.lighting_mode == WORKBENCH_LIGHTING_MATCAP) [[
static_branch]] {
83 N = (mat_data.a > 0.0f) ?
N : -
N;
86 else if (srt.consts.lighting_mode == WORKBENCH_LIGHTING_STUDIO) [[
static_branch]] {
87 float roughness = 0.0f, metallic = 0.0f;
91 else if (srt.consts.lighting_mode == WORKBENCH_LIGHTING_FLAT) [[
static_branch]] {
92 color.rgb = base_color;
95 float cavity = 0.0f, edges = 0.0f, curvature = 0.0f;
98 srt.cavity, srt.world, view, srt.depth_tx, srt.normal_tx, uv, cavity, edges);
104 color.rgb *=
clamp((1.0f - cavity) * (1.0f + edges) * (1.0f + curvature), 0.0f, 4.0f);
111 frag_out.color =
color;
#define compilation_constant
void gpu_discard_fragment()
constexpr T clamp(T, U, U) RET
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
SamplerBase< float, 2, false, false, false, true > sampler2DDepth
SamplerBase< float, 2, false, true > sampler2DArray
SamplerBase< float, 2 > sampler2D
TEX_TEMPLATE SizeVec textureSize(T, int) RET
SamplerBase< uint, 2 > usampler2D
void fullscreen_vertex(int vertex_id, float4 &out_position)
PipelineGraphic opaque_studio_no_cavity_curvature_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_STUDIO,.use_cavity=false,.use_curvature=true,.use_shadow=true })
PipelineGraphic opaque_studio_cavity_no_curvature_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_STUDIO,.use_cavity=true,.use_curvature=false,.use_shadow=true })
PipelineGraphic opaque_flat_no_cavity_curvature_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_FLAT,.use_cavity=false,.use_curvature=true,.use_shadow=true })
PipelineGraphic opaque_studio_cavity_curvature_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_STUDIO,.use_cavity=true,.use_curvature=true,.use_shadow=true })
PipelineGraphic opaque_studio_cavity_no_curvature_no_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_STUDIO,.use_cavity=true,.use_curvature=false,.use_shadow=false})
PipelineGraphic opaque_flat_cavity_curvature_no_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_FLAT,.use_cavity=true,.use_curvature=true,.use_shadow=false})
PipelineGraphic opaque_matcap_cavity_curvature_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_MATCAP,.use_cavity=true,.use_curvature=true,.use_shadow=true })
PipelineGraphic opaque_matcap_no_cavity_no_curvature_no_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_MATCAP,.use_cavity=false,.use_curvature=false,.use_shadow=false})
void frag(const float4 &frag_coord, Resources &srt, draw::View &views, FragOut &frag_out)
void vert(const int &vert_id, float4 &out_pos)
PipelineGraphic opaque_studio_no_cavity_curvature_no_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_STUDIO,.use_cavity=false,.use_curvature=true,.use_shadow=false})
PipelineGraphic opaque_flat_no_cavity_no_curvature_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_FLAT,.use_cavity=false,.use_curvature=false,.use_shadow=true })
PipelineGraphic opaque_matcap_no_cavity_curvature_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_MATCAP,.use_cavity=false,.use_curvature=true,.use_shadow=true })
PipelineGraphic opaque_studio_no_cavity_no_curvature_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_STUDIO,.use_cavity=false,.use_curvature=false,.use_shadow=true })
PipelineGraphic opaque_flat_no_cavity_curvature_no_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_FLAT,.use_cavity=false,.use_curvature=true,.use_shadow=false})
PipelineGraphic opaque_matcap_no_cavity_no_curvature_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_MATCAP,.use_cavity=false,.use_curvature=false,.use_shadow=true })
PipelineGraphic opaque_matcap_cavity_curvature_no_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_MATCAP,.use_cavity=true,.use_curvature=true,.use_shadow=false})
PipelineGraphic opaque_studio_cavity_curvature_no_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_STUDIO,.use_cavity=true,.use_curvature=true,.use_shadow=false})
PipelineGraphic opaque_matcap_cavity_no_curvature_no_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_MATCAP,.use_cavity=true,.use_curvature=false,.use_shadow=false})
PipelineGraphic opaque_matcap_no_cavity_curvature_no_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_MATCAP,.use_cavity=false,.use_curvature=true,.use_shadow=false})
PipelineGraphic opaque_flat_cavity_no_curvature_no_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_FLAT,.use_cavity=true,.use_curvature=false,.use_shadow=false})
PipelineGraphic opaque_flat_cavity_curvature_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_FLAT,.use_cavity=true,.use_curvature=true,.use_shadow=true })
PipelineGraphic opaque_studio_no_cavity_no_curvature_no_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_STUDIO,.use_cavity=false,.use_curvature=false,.use_shadow=false})
PipelineGraphic opaque_matcap_cavity_no_curvature_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_MATCAP,.use_cavity=true,.use_curvature=false,.use_shadow=true })
PipelineGraphic opaque_flat_cavity_no_curvature_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_FLAT,.use_cavity=true,.use_curvature=false,.use_shadow=true })
PipelineGraphic opaque_flat_no_cavity_no_curvature_no_shadow(vert, frag, Constants{.lighting_mode=WORKBENCH_LIGHTING_FLAT,.use_cavity=false,.use_curvature=false,.use_shadow=false})
float3 get_matcap_lighting(const workbench::World &world, sampler2D diffuse_matcap, sampler2D specular_matcap, float3 base_color, float3 N, float3 I)
void float_pair_decode(float data, float &v1, float &v2)
float3 normal_decode(float4 enc)
float get_shadow(const workbench::World &world, float3 N, bool force_shadow)
void cavity_compute(const workbench::Cavity &cavity, const workbench::World &world, ViewMatrices view, sampler2DDepth depth_tx, sampler2D normal_tx, float2 screenco, float &cavities, float &edges)
void curvature_compute(const workbench::World &world, usampler2D object_id_tx, sampler2D normal_tx, float2 uv, float &curvature)
float3 get_world_lighting(const workbench::World &world, float3 base_color, float roughness, float metallic, float3 N, float3 I)
float3 view_incident_vector(float3 vP) const
float3 point_screen_to_view(float3 ssP) const
CCL_NAMESPACE_BEGIN struct Window V