Skip to content

Commit

Permalink
Merge pull request #31 from astrofra/main
Browse files Browse the repository at this point in the history
Visual cleanup
  • Loading branch information
disketflu authored Jan 4, 2023
2 parents 348e110 + 95a3f62 commit 4206a89
Show file tree
Hide file tree
Showing 102 changed files with 14,119 additions and 119 deletions.
Binary file added app/resources/common_maps/bit15m3v_02_orm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/resources/common_maps/bit40m3v_02_orm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/resources/core/shader/pbr.hps
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"features": ["OptionalBaseColorOpacityMap", "OptionalOcclusionRoughnessMetalnessMap", "OptionalNormalMap", "_OptionalAlphaCut", "OptionalSelfMap", "_OptionalSkinning"]
"features": ["OptionalBaseColorOpacityMap", "OptionalOcclusionRoughnessMetalnessMap", "OptionalNormalMap", "OptionalAlphaCut", "OptionalSelfMap", "_OptionalSkinning"]
}
25 changes: 6 additions & 19 deletions app/resources/core/shader/pbr_fs.sc
Original file line number Diff line number Diff line change
Expand Up @@ -180,40 +180,28 @@ void main() {
vec4 jitter = vec4_splat(0.);
#endif // FORWARD_PIPELINE_AAA

float radiance_occluder = 1.0;
vec3 split_color = vec3(1,0,1);

// SLOT 0: linear light
{
float k_shadow = 1.0;
float bias_factor = 0.0;
#if SLOT0_SHADOWS
float k_fade_split = 1.0 - jitter.z * 0.3;
float split_gap = uLinearShadowSlice.w - uLinearShadowSlice.x;

if(view.z < uLinearShadowSlice.x * k_fade_split) {
k_shadow *= SampleShadowPCF(uLinearShadowMap, vLinearShadowCoord0, uShadowState.y * 0.5, uShadowState.z, jitter);
} else if(view.z < uLinearShadowSlice.y * k_fade_split) {
bias_factor = 1.0; // 1.0 + ((uLinearShadowSlice.y - uLinearShadowSlice.x) / split_gap) * 0.5;
split_color = vec3(1,0,0);
k_shadow *= SampleShadowPCF(uLinearShadowMap, vLinearShadowCoord1, uShadowState.y * 0.5, uShadowState.z * bias_factor, jitter);
k_shadow *= SampleShadowPCF(uLinearShadowMap, vLinearShadowCoord1, uShadowState.y * 0.5, uShadowState.z, jitter);
} else if(view.z < uLinearShadowSlice.z * k_fade_split) {
bias_factor = 1.5; // 1.0 + ((uLinearShadowSlice.z - uLinearShadowSlice.x) / split_gap) * 0.5;
split_color = vec3(0,1,0);
k_shadow *= SampleShadowPCF(uLinearShadowMap, vLinearShadowCoord2, uShadowState.y * 0.5, uShadowState.z * bias_factor, jitter);
k_shadow *= SampleShadowPCF(uLinearShadowMap, vLinearShadowCoord2, uShadowState.y * 0.5, uShadowState.z, jitter);
} else if(view.z < uLinearShadowSlice.w * k_fade_split) {
bias_factor = 3.0; // 1.0 + ((uLinearShadowSlice.w - uLinearShadowSlice.x) / split_gap) * 0.5;
split_color = vec3(0,0,1);
#if FORWARD_PIPELINE_AAA
k_shadow *= SampleShadowPCF(uLinearShadowMap, vLinearShadowCoord3, uShadowState.y * 0.5, uShadowState.z * bias_factor, jitter);
k_shadow *= SampleShadowPCF(uLinearShadowMap, vLinearShadowCoord3, uShadowState.y * 0.5, uShadowState.z, jitter);
#else // FORWARD_PIPELINE_AAA
float pcf = SampleShadowPCF(uLinearShadowMap, vLinearShadowCoord3, uShadowState.y * 0.5, uShadowState.z * bias_factor, jitter);
float pcf = SampleShadowPCF(uLinearShadowMap, vLinearShadowCoord3, uShadowState.y * 0.5, uShadowState.z, jitter);
float ramp_len = (uLinearShadowSlice.w - uLinearShadowSlice.z) * 0.25;
float ramp_k = clamp((view.z - (uLinearShadowSlice.w - ramp_len)) / max(ramp_len, 1e-8), 0.0, 1.0);
k_shadow *= pcf * (1.0 - ramp_k) + ramp_k;
k_shadow *= pcf * (1.0 - ramp_k) + ramp_k;
#endif // FORWARD_PIPELINE_AAA
}
radiance_occluder *= k_shadow;
#endif // SLOT0_SHADOWS
color += GGX(V, N, NdotV, uLightDir[0].xyz, base_opacity.xyz, occ_rough_metal.g, occ_rough_metal.b, F0, uLightDiffuse[0].xyz * k_shadow, uLightSpecular[0].xyz * k_shadow);
}
Expand Down Expand Up @@ -255,7 +243,6 @@ void main() {

vec3 irradiance = textureCube(uIrradianceMap, ReprojectProbe(P, N)).xyz;
vec3 radiance = textureCubeLod(uRadianceMap, ReprojectProbe(P, R), occ_rough_metal.y * MAX_REFLECTION_LOD).xyz;
radiance *= (radiance_occluder * 0.9) + 0.1;

#if FORWARD_PIPELINE_AAA
vec4 ss_irradiance = texture2D(uSSIrradianceMap, gl_FragCoord.xy / uResolution.xy);
Expand Down Expand Up @@ -289,7 +276,7 @@ void main() {
float opacity = base_opacity.w;

#if ENABLE_ALPHA_CUT
if (opacity < 0.8)
if (opacity < 0.25)
discard;
#endif // ENABLE_ALPHA_CUT

Expand Down
20 changes: 10 additions & 10 deletions app/resources/main.scn
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
"fog_far": 0.0,
"fog_near": 0.0,
"probe": {
"irradiance_map": "probes/clarens_night_01.hdr.irradiance",
"irradiance_map": "probes/kloppenheim_07_1k.hdr.irradiance",
"parallax": 0.0,
"pos": [
0.0,
0.0,
0.0
],
"radiance_map": "probes/clarens_night_01.hdr.radiance",
"radiance_map": "probes/kloppenheim_07_1k.hdr.radiance",
"rot": [
0.0,
0.0,
Expand Down Expand Up @@ -94,7 +94,7 @@
149,
255
],
"diffuse_intensity": 3.0,
"diffuse_intensity": 2.0,
"inner_angle": 0.5235987901687622,
"outer_angle": 0.7853981852531433,
"priority": 1.0,
Expand Down Expand Up @@ -274,14 +274,14 @@
3.641082763671875
],
"rot": [
13.957301139831543,
-143.81979370117188,
-175.9149169921875
31.516674041748047,
-142.3711395263672,
-175.34832763671875
],
"scl": [
0.999999463558197,
0.9999996423721313,
0.9999996423721313
0.9999995231628418,
0.9999997019767761,
0.9999997019767761
]
},
{
Expand Down Expand Up @@ -401,7 +401,7 @@
],
"rot": [
-0.0,
179.99993896484375,
179.99989318847656,
0.0
],
"scl": [
Expand Down
28 changes: 14 additions & 14 deletions app/resources/main.scn.editor
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"subdiv_size": 1.0
},
"navigation_plugin": {
"orbit_distance": 3.2804996967315674,
"orbit_distance": 707.2493896484375,
"speed": 0.800000011920929,
"turbo": 100.0
},
Expand All @@ -49,7 +49,7 @@
"snap_scale_fine": 1.0,
"snap_translation": 1.0,
"snap_translation_fine": 0.10000000149011612,
"tool": "rotation"
"tool": "move"
},
"view_plugin": {
"show_cameras": true,
Expand Down Expand Up @@ -126,18 +126,18 @@
},
"orthographic_size": 1.0,
"perspective": [
0.9933187961578369,
-0.032980553805828094,
-0.11085270345211029,
0.1620659977197647,
0.0,
0.9585316181182861,
-0.28520330786705017,
4.229660987854004,
0.1156427338719368,
0.2832944393157959,
0.9521146416664124,
-2.8071506023406982
0.9999575614929199,
0.0015850444324314594,
0.01217857375741005,
-4.970130920410156,
0.0,
0.991731584072113,
-0.12884515523910522,
16.081405639648438,
-0.012287206016480923,
0.12884660065174103,
0.991679310798645,
-723.9078979492188
],
"perspective_fov": 0.8872777223587036,
"perspective_zrange": {
Expand Down
4 changes: 2 additions & 2 deletions app/resources/probes/clarens_night_01.hdr.meta
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"profiles": {
"default": {
"generate-probe": true,
"radiance-edge-fixup": true
"generate-probe": false,
"radiance-edge-fixup": false
}
}
}
Binary file added app/resources/probes/kloppenheim_07_1k.hdr
Binary file not shown.
9 changes: 9 additions & 0 deletions app/resources/probes/kloppenheim_07_1k.hdr.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"profiles": {
"default": {
"generate-probe": true,
"max-probe-size": 256,
"radiance-edge-fixup": true
}
}
}
Binary file added app/resources/props/forest_pack_000/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 4206a89

Please sign in to comment.