blob: 6d24b001d4d0cdb9d91020895e19104a77212c89 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#pragma BLENDER_REQUIRE(common_view_lib.glsl)
#pragma BLENDER_REQUIRE(workbench_shader_interface_lib.glsl)
#pragma BLENDER_REQUIRE(workbench_common_lib.glsl)
#pragma BLENDER_REQUIRE(workbench_image_lib.glsl)
layout(location = 0) out vec4 materialData;
layout(location = 1) out WB_Normal normalData;
layout(location = 2) out uint objectId;
uniform bool useMatcap = false;
void main()
{
normalData = workbench_normal_encode(gl_FrontFacing, normal_interp);
materialData = vec4(color_interp, packed_rough_metal);
objectId = uint(object_id);
if (useMatcap) {
/* For matcaps, save front facing in alpha channel. */
materialData.a = float(gl_FrontFacing);
}
#ifdef V3D_SHADING_TEXTURE_COLOR
materialData.rgb = workbench_image_color(uv_interp);
#endif
}
|