From e1743644f25aede2d8fb79c5839c530542ccae4b Mon Sep 17 00:00:00 2001 From: ctwhome Date: Thu, 14 Mar 2024 09:19:28 +0100 Subject: [PATCH] WIP --- src/lib/shaders/volume_transfer.frag | 10 +++++----- src/routes/viewer/sceneSetup/updateMaterial.ts | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/lib/shaders/volume_transfer.frag b/src/lib/shaders/volume_transfer.frag index a2d39b2..15752ec 100644 --- a/src/lib/shaders/volume_transfer.frag +++ b/src/lib/shaders/volume_transfer.frag @@ -1,13 +1,13 @@ // This code is based upon Janelia's web-vol-viewer // https://github.com/JaneliaSciComp/web-vol-viewer -precision highp float; +precision mediump float; in vec3 rayDirUnnorm; in vec3 lightDir; uniform sampler2D transferTex; -// uniform lowp sampler3D volumeTex; uniform lowp sampler3D volumeTex; +uniform lowp sampler3D coarseVolumeTex; uniform float dtScale; uniform float finalGamma; uniform vec3 sunLightColor; @@ -66,7 +66,7 @@ void main(void){ tBox.x=max(tBox.x,0.); - ivec3 volumeTexSize=textureSize(volumeTex,0); + ivec3 volumeTexSize=textureSize(coarseVolumeTex,0); // vec3 dt0 = 1.0 / (vec3(volumeTexSize) * abs(rayDir)); vec3 dt0=1./(vec3(volumeTexSize)*abs(rayDir)); float dt=min(dt0.x,min(dt0.y,dt0.z)) * 0.5; @@ -101,8 +101,8 @@ void main(void){ vec3 random=fract(sin(gl_FragCoord.x*12.9898+gl_FragCoord.y*78.233)*43758.5453)*dt*rayDir/8.0; for(float t=tBox.x;t