const ProgramBuilder::VariableDefinition ProgramBuilder::standard_variables[] =
{
{ FRAGMENT, "gl_FragColor", "vec4", "frag_color", "g" },
- { FRAGMENT, "frag_color", "vec4", "color_base", "!t" },
- { FRAGMENT, "frag_color", "vec4", "tex_sample", "!l!s!mt" },
- { FRAGMENT, "frag_color", "vec4", "tex_sample*color_base", "l|s|mt" },
- { FRAGMENT, "color_base", "vec4", "vec4(1.0)", "!l!s!m" },
- { FRAGMENT, "color_base", "vec4", "color", "!l!sm" },
- { FRAGMENT, "color_base", "vec4", "vec4(vec3(l_shadow), 1.0)", "!ls!m" },
- { FRAGMENT, "color_base", "vec4", "color*vec4(vec3(l_shadow), 1.0)", "!lsm" },
- { FRAGMENT, "color_base", "vec4", "vec4(rgb_light_env, 1.0)", "l!m" },
- { FRAGMENT, "color_base", "vec4", "vec4(rgb_light_env, material.diffuse.a)", "lm" },
- { FRAGMENT, "rgb_light_env", "vec3", "rgb_light_full+reflect_sample.rgb*reflectivity", "e" },
- { FRAGMENT, "rgb_light_env", "vec3", "rgb_light_full", "!e" },
- { FRAGMENT, "rgb_light_full", "vec3", "rgb_light_shadow+ambient_product_diffuse.rgb", "m" },
- { FRAGMENT, "rgb_light_full", "vec3", "rgb_light_shadow", "!m" },
- { FRAGMENT, "ambient_product_diffuse", "vec4", "gl_FrontLightModelProduct.sceneColor", "g" },
- { FRAGMENT, "ambient_product_diffuse", "vec4", "ambient_color*material.diffuse", "!g" },
- { FRAGMENT, "rgb_light_shadow", "vec3", "rgb_light*l_shadow", "s" },
- { FRAGMENT, "rgb_light_shadow", "vec3", "rgb_light", "!s" },
- { FRAGMENT, "rgb_light[i]", "vec3", "vec3(l_diffuse[i])", "!m!p" },
- { FRAGMENT, "rgb_light[i]", "vec3", "vec3(l_diffuse[i]+l_specular[i])", "!mp" },
- { FRAGMENT, "rgb_light[i]", "vec3", "l_diffuse[i]*light_product_diffuse[i].rgb", "m!p" },
- { FRAGMENT, "rgb_light[i]", "vec3", "l_diffuse[i]*light_product_diffuse[i].rgb+l_specular[i]*light_product_specular[i].rgb", "mp" },
- { FRAGMENT, "light_product_diffuse[i]", "vec4", "gl_FrontLightProduct[i].diffuse", "g" },
- { FRAGMENT, "light_product_diffuse[i]", "vec4", "light_sources[i].diffuse*material.diffuse", "!g" },
- { FRAGMENT, "light_product_specular[i]", "vec4", "gl_FrontLightProduct[i].specular", "g" },
- { FRAGMENT, "light_product_specular[i]", "vec4", "light_sources[i].specular*material.specular", "!g" },
+ { FRAGMENT, "frag_color", "vec4", "basic_color", "!e!l" },
+ { FRAGMENT, "frag_color", "vec4", "vec4(rgb_surface, surface_alpha)", "!el" },
+ { FRAGMENT, "frag_color", "vec4", "vec4(rgb_surface+rgb_reflection, surface_alpha)", "e" },
+
+ { FRAGMENT, "rgb_reflection", "vec3", "reflect_sample.rgb*reflectivity", 0 },
{ FRAGMENT, "reflect_sample", "vec4", "textureCube(environment, env_reflect_dir)", 0 },
{ FRAGMENT, "env_reflect_dir", "vec3", "env_eye_matrix*eye_reflect_dir", 0 },
{ FRAGMENT, "eye_reflect_dir", "vec3", "eye_tbn_matrix*tbn_reflect_dir", "n" },
- { FRAGMENT, "zzz_reflect_dir", "vec3", "reflect(zzz_incident_dir, n_zzz_normal)", 0 },
+
+ { FRAGMENT, "rgb_surface", "vec3", "rgb_unlit_surface", "!l" },
+ { FRAGMENT, "rgb_surface", "vec3", "rgb_lit_surface", "l" },
+ { FRAGMENT, "rgb_unlit_surface", "vec3", "basic_color.rgb", "!s" },
+ { FRAGMENT, "rgb_unlit_surface", "vec3", "basic_color.rgb*l_shadow", "s" },
+ { FRAGMENT, "rgb_lit_surface", "vec3", "rgb_illumination_diffuse", "!m" },
+ { FRAGMENT, "rgb_lit_surface", "vec3", "rgb_surface_ambient+rgb_surface_diffuse", "m!p" },
+ { FRAGMENT, "rgb_lit_surface", "vec3", "rgb_surface_ambient+rgb_surface_diffuse+rgb_surface_specular", "mp" },
+
+ { FRAGMENT, "surface_alpha", "float", "basic_color.a", "!m" },
+ { FRAGMENT, "surface_alpha", "float", "basic_color.a", "m!l" },
+ { FRAGMENT, "surface_alpha", "float", "material.diffuse.a", "ml!t" },
+ { FRAGMENT, "surface_alpha", "float", "material.diffuse.a*tex_sample.a", "mlt" },
+ { FRAGMENT, "basic_color", "vec4", "vec4(1.0)", "!m!t" },
+ { FRAGMENT, "basic_color", "vec4", "tex_sample", "!mt" },
+ { FRAGMENT, "basic_color", "vec4", "color", "m!t" },
+ { FRAGMENT, "basic_color", "vec4", "color*tex_sample", "mt" },
+
+ { FRAGMENT, "rgb_surface_ambient", "vec3", "rgb_illumination_ambient*material.ambient.rgb", "!t" },
+ { FRAGMENT, "rgb_surface_ambient", "vec3", "rgb_illumination_ambient*material.ambient.rgb*tex_sample.rgb", "t" },
+ { FRAGMENT, "rgb_illumination_ambient", "vec3", "ambient_color.rgb", 0 },
+
+ { FRAGMENT, "rgb_surface_specular", "vec3", "rgb_illumination_specular*material.specular.rgb", 0 },
+ { FRAGMENT, "rgb_illumination_specular", "vec3", "rgb_light_specular", "!s" },
+ { FRAGMENT, "rgb_illumination_specular", "vec3", "rgb_light_specular*l_shadow", "s" },
+ { FRAGMENT, "rgb_light_specular[i]", "vec3", "l_specular[i]*light_sources[i].specular.rgb", 0 },
+ { FRAGMENT, "l_specular[i]", "float", "pow(max(dot(n_zzz_half_vec[i], n_zzz_normal), 0.0), material.shininess)", 0 },
+
+ { FRAGMENT, "rgb_surface_diffuse", "vec3", "rgb_illumination_diffuse*material.diffuse.rgb", "!t" },
+ { FRAGMENT, "rgb_surface_diffuse", "vec3", "rgb_illumination_diffuse*material.diffuse.rgb*tex_sample.rgb", "t" },
+ { FRAGMENT, "rgb_illumination_diffuse", "vec3", "rgb_light_diffuse", "!s" },
+ { FRAGMENT, "rgb_illumination_diffuse", "vec3", "rgb_light_diffuse*l_shadow", "s" },
+ { FRAGMENT, "rgb_light_diffuse[i]", "vec3", "l_diffuse[i]*light_sources[i].diffuse.rgb", 0 },
+ { FRAGMENT, "l_diffuse[i]", "float", "max(dot(n_zzz_normal, n_zzz_light_dir[i]), 0.0)", 0 },
+
{ FRAGMENT, "l_shadow", "float", "mix(1.0, shadow_sample, shadow_darkness)", 0 },
{ FRAGMENT, "shadow_sample", "float", "shadow2D(shadow, shd_vertex).r", 0 },
- { FRAGMENT, "l_diffuse[i]", "float", "max(dot(n_zzz_normal, n_zzz_light_dir[i]), 0.0)", 0 },
- { FRAGMENT, "l_specular[i]", "float", "pow(max(dot(n_zzz_half_vec[i], n_zzz_normal), 0.0), material.shininess)", 0 },
+
+ { FRAGMENT, "zzz_reflect_dir", "vec3", "reflect(zzz_incident_dir, n_zzz_normal)", 0 },
{ FRAGMENT, "n_zzz_half_vec[i]", "vec3", "normalize(zzz_light_dir[i]-zzz_incident_dir)", 0 },
{ FRAGMENT, "n_zzz_light_dir[i]", "vec3", "normalize(zzz_light_dir[i])", 0 },
{ FRAGMENT, "n_tbn_normal", "vec3", "normal_sample*2.0-1.0", "n" },