Skip to content

Commit

Permalink
extract depth/view reconstruction from ssao
Browse files Browse the repository at this point in the history
these utilities can be used by other materials
  • Loading branch information
pixelflinger committed May 18, 2023
1 parent ddfeaef commit 2c6f723
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions filament/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ add_custom_command(
OUTPUT "${MATERIAL_DIR}/sao.filamat"
DEPENDS src/materials/ssao/ssaoUtils.fs
DEPENDS src/materials/ssao/ssct.fs
DEPENDS src/materials/ssao/depthUtils.fs
DEPENDS src/materials/ssao/geometry.fs
DEPENDS src/materials/utils/depthUtils.fs
DEPENDS src/materials/utils/geometry.fs
DEPENDS src/materials/ssao/saoImpl.fs
DEPENDS src/materials/ssao/ssctImpl.fs
APPEND
Expand All @@ -405,8 +405,8 @@ add_custom_command(
OUTPUT "${MATERIAL_DIR}/saoBentNormals.filamat"
DEPENDS src/materials/ssao/ssaoUtils.fs
DEPENDS src/materials/ssao/ssct.fs
DEPENDS src/materials/ssao/depthUtils.fs
DEPENDS src/materials/ssao/geometry.fs
DEPENDS src/materials/utils/depthUtils.fs
DEPENDS src/materials/utils/geometry.fs
DEPENDS src/materials/ssao/saoImpl.fs
DEPENDS src/materials/ssao/ssctImpl.fs
APPEND
Expand Down
2 changes: 1 addition & 1 deletion filament/src/materials/ssao/sao.mat
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ fragment {

#include "saoImpl.fs"
#include "ssctImpl.fs"
#include "geometry.fs"
#include "../utils/geometry.fs"
#include "ssaoUtils.fs"

void dummy(){}
Expand Down
2 changes: 1 addition & 1 deletion filament/src/materials/ssao/saoBentNormals.mat
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ fragment {

#include "saoImpl.fs"
#include "ssctImpl.fs"
#include "geometry.fs"
#include "../utils/geometry.fs"
#include "ssaoUtils.fs"

void dummy(){}
Expand Down
2 changes: 1 addition & 1 deletion filament/src/materials/ssao/saoImpl.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/

#include "ssaoUtils.fs"
#include "geometry.fs"
#include "../utils/geometry.fs"

#ifndef COMPUTE_BENT_NORMAL
#error COMPUTE_BENT_NORMAL must be set
Expand Down
2 changes: 1 addition & 1 deletion filament/src/materials/ssao/ssaoUtils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef FILAMENT_MATERIALS_SSAO_UTILS
#define FILAMENT_MATERIALS_SSAO_UTILS

#include "depthUtils.fs"
#include "../utils/depthUtils.fs"

vec2 pack(highp float normalizedDepth) {
// we need 16-bits of precision
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ highp vec3 computeViewSpaceNormal(
highp vec2 texel, highp vec2 positionParams) {
// todo: maybe make this a quality parameter
#if FILAMENT_QUALITY == FILAMENT_QUALITY_HIGH
vec3 normal = computeViewSpaceNormalHighQ(materialParams_depth, uv, depth, position,
vec3 normal = computeViewSpaceNormalHighQ(depthTexture, uv, depth, position,
texel, positionParams);
#else
vec3 normal = computeViewSpaceNormalMediumQ(materialParams_depth, uv, position,
vec3 normal = computeViewSpaceNormalMediumQ(depthTexture, uv, position,
texel, positionParams);
#endif
return normal;
Expand Down

0 comments on commit 2c6f723

Please sign in to comment.