Skip to content
Snippets Groups Projects
Verified Commit 886de27e authored by tristan.muller's avatar tristan.muller Committed by philippe.verley_ird.fr
Browse files

Remove FXAA from the visualization project

parent 5c045463
No related branches found
No related tags found
No related merge requests found
...@@ -216,9 +216,8 @@ public class VisualizationScene extends Scene { ...@@ -216,9 +216,8 @@ public class VisualizationScene extends Scene {
mainCamera.addLayout("background"); mainCamera.addLayout("background");
mainCamera.addLayout("voxel"); mainCamera.addLayout("voxel");
mainCamera.addPostProcess(0, new TonemappingPostProcess()); mainCamera.addPostProcess(0, new TonemappingPostProcess());
mainCamera.addPostProcess(1, new FXAAPostProcess()); mainCamera.addPostProcess(1, new SharpenPostProcess());
mainCamera.addPostProcess(2, new SharpenPostProcess()); mainCamera.addPostProcess(2, new GammaCorrectionPostProcess());
mainCamera.addPostProcess(3, new GammaCorrectionPostProcess());
mainCameraEntity.addComponent(mainCamera); mainCameraEntity.addComponent(mainCamera);
addEntity(mainCameraEntity); addEntity(mainCameraEntity);
...@@ -266,8 +265,7 @@ public class VisualizationScene extends Scene { ...@@ -266,8 +265,7 @@ public class VisualizationScene extends Scene {
miniCamera.setProportions(new Vector4f(0.75f, -0.02f, 0.25f, 0.25f)); miniCamera.setProportions(new Vector4f(0.75f, -0.02f, 0.25f, 0.25f));
miniCamera.addPostProcess(0, new TonemappingPostProcess()); miniCamera.addPostProcess(0, new TonemappingPostProcess());
miniCamera.addPostProcess(1, new SharpenPostProcess()); miniCamera.addPostProcess(1, new SharpenPostProcess());
miniCamera.addPostProcess(2, new FXAAPostProcess()); miniCamera.addPostProcess(2, new GammaCorrectionPostProcess());
miniCamera.addPostProcess(3, new GammaCorrectionPostProcess());
miniCameraEntity = new Entity(); miniCameraEntity = new Entity();
miniCameraEntity.setParent(cameraControllerEntity); miniCameraEntity.setParent(cameraControllerEntity);
......
...@@ -4,15 +4,15 @@ uniform sampler2D screenTexture; ...@@ -4,15 +4,15 @@ uniform sampler2D screenTexture;
/* Output color */ /* Output color */
out vec4 color; out vec4 color;
//#ifndef FXAA_REDUCE_MIN #ifndef FXAA_REDUCE_MIN
#define FXAA_REDUCE_MIN (1.0/ 128.0) #define FXAA_REDUCE_MIN (1.0/ 128.0)
//#endif #endif
//#ifndef FXAA_REDUCE_MUL #ifndef FXAA_REDUCE_MUL
#define FXAA_REDUCE_MUL (1.0 / 8.0) #define FXAA_REDUCE_MUL (1.0 / 8.0)
//#endif #endif
//#ifndef FXAA_SPAN_MAX #ifndef FXAA_SPAN_MAX
#define FXAA_SPAN_MAX 8.0 #define FXAA_SPAN_MAX 8.0
//#endif #endif
vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution) { vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution) {
mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y); mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);
...@@ -66,7 +66,6 @@ vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution) { ...@@ -66,7 +66,6 @@ vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution) {
void main(void) void main(void)
{ {
vec2 fragCoord = viewSpaceTexcoord * resolution;
float alpha = texture2D(screenTexture, viewSpaceTexcoord).a; float alpha = texture2D(screenTexture, viewSpaceTexcoord).a;
color = vec4(fxaa(screenTexture, fragCoord, resolution).rgb, alpha); color = vec4(fxaa(screenTexture, viewSpaceTexcoord * resolution, resolution).rgb, alpha);
} }
\ No newline at end of file
...@@ -7,7 +7,8 @@ out vec4 color; ...@@ -7,7 +7,8 @@ out vec4 color;
/** /**
* Apply a sharpen effect to the specified texture. * Apply a sharpen effect to the specified texture.
*/ */
vec4 sharpen(in sampler2D tex, in vec2 coords, in float offset) { vec4 sharpen(in sampler2D tex, in vec2 coords, in float offset)
{
float dx = offset / resolution.x; float dx = offset / resolution.x;
float dy = offset / resolution.y; float dy = offset / resolution.y;
vec4 sum = vec4(0.0); vec4 sum = vec4(0.0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment