Differential D13910 Diff 47376 source/blender/draw/engines/workbench/shaders/workbench_volume_vert.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/shaders/workbench_volume_vert.glsl
| #pragma BLENDER_REQUIRE(common_view_lib.glsl) | #pragma BLENDER_REQUIRE(common_view_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(gpu_shader_common_obinfos_lib.glsl) | |||||
| uniform float slicePosition; | |||||
| uniform int sliceAxis; /* -1 is no slice, 0 is X, 1 is Y, 2 is Z. */ | |||||
| uniform mat4 volumeTextureToObject; | |||||
| in vec3 pos; | |||||
| RESOURCE_ID_VARYING | RESOURCE_ID_VARYING | ||||
| #ifdef VOLUME_SLICE | |||||
| in vec3 uvs; | |||||
| out vec3 localPos; | |||||
| #endif | |||||
| void main() | void main() | ||||
| { | { | ||||
| #ifdef VOLUME_SLICE | #ifdef VOLUME_SLICE | ||||
| if (sliceAxis == 0) { | if (sliceAxis == 0) { | ||||
| localPos = vec3(slicePosition * 2.0 - 1.0, pos.xy); | localPos = vec3(slicePosition * 2.0 - 1.0, pos.xy); | ||||
| } | } | ||||
| else if (sliceAxis == 1) { | else if (sliceAxis == 1) { | ||||
| localPos = vec3(pos.x, slicePosition * 2.0 - 1.0, pos.y); | localPos = vec3(pos.x, slicePosition * 2.0 - 1.0, pos.y); | ||||
| Show All 18 Lines | |||||