Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ae95ae
commit 1f3df6c
Showing
5 changed files
with
215 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
void main() { | ||
gl_FragColor = gl_Color; | ||
} |
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,29 @@ | ||
//uniform sampler2DRect src_tex_unit0; | ||
|
||
uniform float focalDistance; | ||
uniform float focalRange; | ||
uniform float maxSize; | ||
uniform float minSize; | ||
|
||
const float PI = 3.14159265; | ||
//const float maxSize = 32.; | ||
|
||
void main() { | ||
//get the homogeneous 2d position | ||
//gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; | ||
// use the distance from the camera and aperture to determine the radius | ||
// the +1 is because point sizes <1 are rendered differently than those >1 | ||
//gl_PointSize = min(maxSize, abs(gl_Position.z - focalDistance) * aperture + 1.); | ||
gl_Position = ftransform(); | ||
gl_PointSize = min(maxSize, abs(gl_Position.z - focalDistance) / focalRange + minSize); | ||
gl_FrontColor = gl_Color; | ||
float radius = gl_PointSize / 2.; | ||
|
||
//gl_FrontColor = texture2DRect(src_tex_unit0, gl_MultiTexCoord0.xy); | ||
// divide the color alpha by the area | ||
//gl_FrontColor.a *= focalRange; | ||
//gl_FrontColor.a /= PI * radius * radius; | ||
gl_FrontColor.a = 1.0 - (gl_PointSize - minSize) / (maxSize - minSize); | ||
//gl_PointSize = 4.0; | ||
//gl_FrontColor = vec4(1.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
Oops, something went wrong.