LibCarna Version 3.4.0
Loading...
Searching...
No Matches
mip.frag
1#version 330
2
3/*
4 * Copyright (C) 2010 - 2016 Leonid Kostrykin
5 *
6 * Chair of Medical Engineering (mediTEC)
7 * RWTH Aachen University
8 * Pauwelsstr. 20
9 * 52074 Aachen
10 * Germany
11 *
12 *
13 * Copyright (C) 2021 - 2025 Leonid Kostrykin
14 *
15 */
16
17uniform sampler3D intensities;
18uniform mat4 modelTexture;
19
20in vec4 modelSpaceCoordinates;
21
22layout( location = 0 ) out vec4 _gl_FragColor;
23
24
25// ----------------------------------------------------------------------------------
26// Fragment Procedure
27// ----------------------------------------------------------------------------------
28
29void main()
30{
31 if( abs( modelSpaceCoordinates.x ) > 0.5 || abs( modelSpaceCoordinates.y ) > 0.5 || abs( modelSpaceCoordinates.z ) > 0.5 )
32 {
33 discard;
34 }
35
36 vec4 textureCoordinates = modelTexture * modelSpaceCoordinates;
37 float intensity = texture( intensities, textureCoordinates.xyz ).r;
38
39 _gl_FragColor = vec4( intensity, 0, 0, 1 );
40}