Differential D4694 Diff 14819 source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/shaders/workbench_prepass_frag.glsl
| Show All 10 Lines | |||||
| #ifdef NORMAL_VIEWPORT_PASS_ENABLED | #ifdef NORMAL_VIEWPORT_PASS_ENABLED | ||||
| in vec3 normal_viewport; | in vec3 normal_viewport; | ||||
| #endif | #endif | ||||
| #ifdef V3D_SHADING_TEXTURE_COLOR | #ifdef V3D_SHADING_TEXTURE_COLOR | ||||
| in vec2 uv_interp; | in vec2 uv_interp; | ||||
| #endif | #endif | ||||
| #ifdef V3D_SHADING_VERTEX_COLOR | |||||
| in vec3 vertexColor; | |||||
| #endif | |||||
| #ifdef HAIR_SHADER | #ifdef HAIR_SHADER | ||||
| flat in float hair_rand; | flat in float hair_rand; | ||||
| #endif | #endif | ||||
| #ifdef MATDATA_PASS_ENABLED | #ifdef MATDATA_PASS_ENABLED | ||||
| layout(location = 0) out vec4 materialData; | layout(location = 0) out vec4 materialData; | ||||
| #endif | #endif | ||||
| #ifdef OBJECT_ID_PASS_ENABLED | #ifdef OBJECT_ID_PASS_ENABLED | ||||
| layout(location = 1) out uint objectId; | layout(location = 1) out uint objectId; | ||||
| #endif | #endif | ||||
| #ifdef NORMAL_VIEWPORT_PASS_ENABLED | #ifdef NORMAL_VIEWPORT_PASS_ENABLED | ||||
| layout(location = 2) out WB_Normal normalViewport; | layout(location = 2) out WB_Normal normalViewport; | ||||
| #endif | #endif | ||||
| void main() | void main() | ||||
| { | { | ||||
| #ifdef MATDATA_PASS_ENABLED | #ifdef MATDATA_PASS_ENABLED | ||||
| float metallic, roughness; | float metallic, roughness; | ||||
| vec4 color; | vec4 color; | ||||
| # ifdef V3D_SHADING_TEXTURE_COLOR | # if defined(V3D_SHADING_TEXTURE_COLOR) | ||||
| color = workbench_sample_texture(image, uv_interp, imageSrgb, imageNearest); | color = workbench_sample_texture(image, uv_interp, imageSrgb, imageNearest); | ||||
| if (color.a < ImageTransparencyCutoff) { | if (color.a < ImageTransparencyCutoff) { | ||||
| discard; | discard; | ||||
| } | } | ||||
| # elif defined(V3D_SHADING_VERTEX_COLOR) | |||||
| color.rgb = vertexColor; | |||||
| # else | # else | ||||
| color.rgb = materialDiffuseColor; | color.rgb = materialDiffuseColor; | ||||
| # endif | # endif | ||||
| # ifdef V3D_LIGHTING_MATCAP | # ifdef V3D_LIGHTING_MATCAP | ||||
| /* Encode front facing in metallic channel. */ | /* Encode front facing in metallic channel. */ | ||||
| metallic = float(gl_FrontFacing); | metallic = float(gl_FrontFacing); | ||||
| roughness = 0.0; | roughness = 0.0; | ||||
| Show All 27 Lines | |||||