Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/constants/shaders/fuseF.frag
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ uniform vec2 lutMinMax;
// src texture is the raw volume intensity data
uniform sampler2D srcTexture;

void main()
{
void main() {
ivec2 vUv = ivec2(int(gl_FragCoord.x), int(gl_FragCoord.y));

// load from channel
Expand All @@ -21,5 +20,5 @@ void main()
float ilookup = float(float(intensity) - lutMinMax.x) / float(lutMinMax.y - lutMinMax.x);
// apply lut to intensity:
vec4 pix = texture(lutSampler, vec2(ilookup, 0.5));
gl_FragColor = vec4(pix.xyz*pix.w, pix.w);
gl_FragColor = vec4(pix.xyz * pix.w, pix.w);
}
5 changes: 2 additions & 3 deletions src/constants/shaders/fuseI.frag
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ uniform vec2 lutMinMax;
// src texture is the raw volume intensity data
uniform isampler2D srcTexture;

void main()
{
void main() {
ivec2 vUv = ivec2(int(gl_FragCoord.x), int(gl_FragCoord.y));
int intensity = texelFetch(srcTexture, vUv, 0).r;
float ilookup = float(float(intensity) - lutMinMax.x) / float(lutMinMax.y - lutMinMax.x);
// apply lut to intensity:
vec4 pix = texture(lutSampler, vec2(ilookup, 0.5));
gl_FragColor = vec4(pix.xyz*pix.w, pix.w);
gl_FragColor = vec4(pix.xyz * pix.w, pix.w);
}
Loading