Skip to content

Commit

Permalink
Merge pull request #155 from shadielhajj/bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
patriciogonzalezvivo authored Jul 6, 2024
2 parents 9429528 + cd17147 commit 0d4aec1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions color/mixOklab.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ float3 mixOklab( float3 colA, float3 colB, float h ) {
colB = srgb2rgb(colB);
#endif

float3 lmsA = pow( mul(RGB2OKLAB_B, colA), float3(0.33333) );
float3 lmsB = pow( mul(RGB2OKLAB_B, colB), float3(0.33333) );
float3 lmsA = pow(mul(RGB2OKLAB_B, colA), float3(0.33333, 0.33333, 0.33333));
float3 lmsB = pow(mul(RGB2OKLAB_B, colB), float3(0.33333, 0.33333, 0.33333));
float3 lms = lerp( lmsA, lmsB, h );

// cone to rgb
Expand All @@ -44,6 +44,6 @@ float3 mixOklab( float3 colA, float3 colB, float h ) {
}

float4 mixOklab( float4 colA, float4 colB, float h ) {
return float4( mixOklab(colA.rgb, colB.rgb, h), mix(colA.a, colB.a, h) );
return float4( mixOklab(colA.rgb, colB.rgb, h), lerp(colA.a, colB.a, h) );
}
#endif
2 changes: 1 addition & 1 deletion color/space/rgb2oklab.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const float3x3 RGB2OKLAB_B = float3x3(
#define FNC_RGB2OKLAB
float3 rgb2oklab(float3 rgb) {
float3 lms = mul(RGB2OKLAB_B, rgb);
return mul(RGB2OKLAB_A, sign(lms)*pow(abs(lms), float3(0.3333333333333)));
return mul(RGB2OKLAB_A, sign(lms) * pow(abs(lms), float3(0.3333333333333, 0.3333333333333, 0.3333333333333)));

}
float4 rgb2oklab(float4 rgb) { return float4(rgb2oklab(rgb.rgb), rgb.a); }
Expand Down
2 changes: 2 additions & 0 deletions lighting/pbrClearCoat.hlsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "material.hlsl"
#include "fresnelReflection.hlsl"
#include "light/point.hlsl"
#include "light/new.hlsl"
#include "light/resolve.hlsl"
#include "light/directional.hlsl"
#include "envMap.hlsl"

Expand Down

0 comments on commit 0d4aec1

Please sign in to comment.