Skip to content

Commit

Permalink
Implement PBR Shaders (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
datacrystals committed Apr 16, 2022
1 parent f5e2894 commit 066b5b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Source/EditorAssets/Projects/DefaultProject/10040.ERS
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@ void main()





5 changes: 3 additions & 2 deletions Source/EditorAssets/Projects/DefaultProject/10041.ERS
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ vec3 PBRPointLight(STRUCT_PointLight Light, vec3 ViewDir, vec3 Reflectance, STRU
vec3 H = normalize(ViewDir + L);
float distance = length(Light.Position - Object.WorldPos);
float attenuation = 1.0 / (distance * distance);
vec3 radiance = Light.Color * attenuation;
vec3 radiance = Light.Color * Light.Intensity * attenuation;

// Cook-Torrance BRDF
float NDF = DistributionGGX(Model.Normal, H, Model.Roughness);
Expand Down Expand Up @@ -399,7 +399,7 @@ vec3 PBRSpotLight(STRUCT_SpotLight Light, vec3 ViewDir, vec3 Reflectance, STRUCT
vec3 H = normalize(ViewDir + L);
float distance = length(Light.Position - Object.WorldPos);
float attenuation = 1.0 / (distance * distance);
vec3 radiance = Light.Color * attenuation;
vec3 radiance = Light.Color * Light.Intensity * attenuation;

// Cook-Torrance BRDF
float NDF = DistributionGGX(Model.Normal, H, Model.Roughness);
Expand Down Expand Up @@ -479,3 +479,4 @@ void main() {
}



0 comments on commit 066b5b6

Please sign in to comment.