-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added 5 more kernels for the KDE rendering
- Loading branch information
Showing
9 changed files
with
86 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
vec3 color_mapping(float intensity, sampler2D colormapTexture){ | ||
return texture(colormapTexture, vec2(intensity,0)).rgb; | ||
vec4 color_mapping(float intensity, sampler2D colormapTexture){ | ||
return texture(colormapTexture, vec2(intensity,0)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// This assumes the center of the normal distribution is the center of the screen | ||
#define PI 3.1415926 | ||
float kde(vec3 point, float sigma){ | ||
float norm = (PI/(4.0*sigma)); | ||
return norm*cos(PI*length(point)/(2*sigma))*int(length(point) < sigma); | ||
} | ||
|
||
|
||
// This requires a center to be passed | ||
// float kde(vec3 point, vec3 center, float sigma){ | ||
// return cos(PI*length(center - point)/(2*sigma))*int(length(center - point) < sigma); | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// This assumes the center of the normal distribution is the center of the screen | ||
float kde(vec3 point, float sigma){ | ||
float norm = (3.0/(4.0*sigma)); | ||
return norm*(1.0 - (length(point)*length(point))/(sigma*sigma)); | ||
} | ||
|
||
|
||
// This requires a center to be passed | ||
// float kde(vec3 point, vec3 center, float sigma){ | ||
// return 1.0 - (length(center - point)*length(center - point))/(sigma*sigma); | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// This assumes the center of the normal distribution is the center of the screen | ||
#define E 2.7182818 | ||
float kde(vec3 point, float sigma){ | ||
return exp(-1.0*length(point)/sigma); | ||
} | ||
|
||
|
||
// This requires a center to be passed | ||
// float kde(vec3 point, vec3 center, float sigma){ | ||
// return exp(-1.0*length(center - point)/sigma); | ||
// } |
3 changes: 2 additions & 1 deletion
3
fury/shaders/utils/normal_distribution.glsl → .../shaders/utils/gaussian_distribution.glsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// This assumes the center of the normal distribution is the center of the screen | ||
float kde(vec3 point, float sigma){ | ||
float norm = (1.0/sigma); | ||
return norm*(1.0 - length(point)/sigma)*int(length(point) < sigma); | ||
} | ||
|
||
|
||
// This requires a center to be passed | ||
// float kde(vec3 point, vec3 center, float sigma){ | ||
// return (1.0 - length(center - point)/sigma)*int(length(center - point) < sigma); | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// This assumes the center of the normal distribution is the center of the screen | ||
float kde(vec3 point, float sigma){ | ||
float norm = (1.0/sigma*2.0); | ||
return norm*int(length(point) < sigma); | ||
} | ||
|
||
|
||
// This requires a center to be passed | ||
// float kde(vec3 point, vec3 center, float sigma){ | ||
// return 1.0*int(length(center - point) < sigma); | ||
// } |