Skip to content

Commit

Permalink
fix: CameraInfo.clipTransform typo
Browse files Browse the repository at this point in the history
  • Loading branch information
0o001 authored and pixelflinger committed Oct 11, 2023
1 parent eeb5360 commit b5e2316
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion filament/src/PerShadowMapUniforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void PerShadowMapUniforms::prepareCamera(Transaction const& transaction,
s.clipFromWorldMatrix[0] = clipFromWorld; // projection * view
s.worldFromClipMatrix = worldFromClip; // 1/(projection * view)
s.userWorldFromWorldMatrix = mat4f(inverse(camera.worldOrigin));
s.clipTransform = camera.clipTransfrom;
s.clipTransform = camera.clipTransform;
s.cameraFar = camera.zf;
s.oneOverFarMinusNear = 1.0f / (camera.zf - camera.zn);
s.nearOverFarMinusNear = camera.zn / (camera.zf - camera.zn);
Expand Down
2 changes: 1 addition & 1 deletion filament/src/PerViewUniforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void PerViewUniforms::prepareCamera(FEngine& engine, const CameraInfo& camera) n
s.viewFromClipMatrix = viewFromClip; // 1/projection
s.worldFromClipMatrix = worldFromClip; // 1/(projection * view)
s.userWorldFromWorldMatrix = mat4f(inverse(camera.worldOrigin));
s.clipTransform = camera.clipTransfrom;
s.clipTransform = camera.clipTransform;
s.cameraFar = camera.zf;
s.oneOverFarMinusNear = 1.0f / (camera.zf - camera.zn);
s.nearOverFarMinusNear = camera.zn / (camera.zf - camera.zn);
Expand Down
2 changes: 1 addition & 1 deletion filament/src/PostProcessManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2503,7 +2503,7 @@ void PostProcessManager::prepareTaa(FrameGraph& fg, filament::Viewport const& sv
inoutCameraInfo->projection[2].xy -= jitterInClipSpace;
// VERTEX_DOMAIN_DEVICE doesn't apply the projection, but it still needs this
// clip transform, so we apply it separately (see main.vs)
inoutCameraInfo->clipTransfrom.zw -= jitterInClipSpace;
inoutCameraInfo->clipTransform.zw -= jitterInClipSpace;

fg.addTrivialSideEffectPass("Jitter Camera",
[=, &uniforms] (DriverApi& driver) {
Expand Down
2 changes: 1 addition & 1 deletion filament/src/details/Camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ struct CameraInfo {
math::mat4f eyeFromView[CONFIG_STEREOSCOPIC_EYES]; // eye view matrix (only for stereoscopic)
math::mat4 worldOrigin; // world origin transform (already applied
// to model and view)
math::float4 clipTransfrom{1, 1, 0, 0}; // clip-space transform, only for VERTEX_DOMAIN_DEVICE
math::float4 clipTransform{1, 1, 0, 0}; // clip-space transform, only for VERTEX_DOMAIN_DEVICE
float zn{}; // distance (positive) to the near plane
float zf{}; // distance (positive) to the far plane
float ev100{}; // exposure
Expand Down
2 changes: 1 addition & 1 deletion filament/src/details/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ void FRenderer::renderJob(ArenaScope& arena, FView& view) {

// VERTEX_DOMAIN_DEVICE doesn't apply the projection, but it still needs this
// clip transform, so we apply it separately (see main.vs)
cameraInfo.clipTransfrom = { ts[0][0], ts[1][1], ts[3].x, ts[3].y };
cameraInfo.clipTransform = { ts[0][0], ts[1][1], ts[3].x, ts[3].y };

// adjust svp to the new, larger, rendering dimensions
svp.width = uint32_t(width);
Expand Down
2 changes: 1 addition & 1 deletion shaders/src/fog.fs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ vec4 fog(vec4 color, highp vec3 view) {

// when sampling the IBL we need to take into account the IBL transform. We know it's a
// a rigid transform, so we can take the transpose instead of the inverse, and for the
// same reason we can use it directly instead of taking the cof() to transfrom a vector.
// same reason we can use it directly instead of taking the cof() to transform a vector.
highp mat3 worldFromUserWorldMatrix = transpose(mat3(frameUniforms.userWorldFromWorldMatrix));
fogColor *= textureLod(light_fog, worldFromUserWorldMatrix * view, lod).rgb;
}
Expand Down

0 comments on commit b5e2316

Please sign in to comment.