mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-22 02:48:25 -05:00
Clean up. Added the raycasting number of steps as a slider for user's control.
This commit is contained in:
@@ -28,7 +28,6 @@ uniform sampler2D exitColorTexture;
|
||||
uniform sampler2D exitDepthTexture;
|
||||
uniform sampler2D mainDepthTexture;
|
||||
|
||||
uniform bool insideRaycaster;
|
||||
uniform vec3 cameraPosInRaycaster;
|
||||
uniform vec2 windowSize;
|
||||
|
||||
@@ -53,6 +52,7 @@ out vec4 finalColor;
|
||||
void main() {
|
||||
vec2 texCoord = vec2(gl_FragCoord.xy / windowSize);
|
||||
|
||||
// Boundary position in view space
|
||||
vec4 exitColorTexture = texture(exitColorTexture, texCoord);
|
||||
|
||||
// If we don't have an exit, discard the ray
|
||||
@@ -80,7 +80,7 @@ void main() {
|
||||
vec3 direction = normalize(diff);
|
||||
float raycastDepth = length(diff);
|
||||
|
||||
float geoDepth = denormalizeFloat(texelFetch(mainDepthTexture, ivec2(gl_FragCoord), 0).x);
|
||||
float geoDepth = denormalizeFloat((texture(mainDepthTexture, texCoord).x));
|
||||
float geoRatio = clamp((geoDepth - entryDepth) / (exitDepth - entryDepth), 0.f, 1.f);
|
||||
raycastDepth = geoRatio * raycastDepth;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user