Probe fixes
This commit is contained in:
parent
eca85d6817
commit
a7d14cb444
|
@ -4,9 +4,9 @@
|
|||
#include "std/gbuffer.glsl"
|
||||
|
||||
uniform samplerCube probeTex;
|
||||
uniform sampler2D gbufferD;
|
||||
uniform sampler2D gbuffer0;
|
||||
uniform sampler2D gbuffer1;
|
||||
uniform sampler2D gbufferD;
|
||||
uniform mat4 invVP;
|
||||
uniform vec3 probep;
|
||||
uniform vec3 eye;
|
||||
|
|
|
@ -39,6 +39,9 @@ void main() {
|
|||
vec3 wp = getPos2(invVP, depth, texCoord);
|
||||
vec4 pp = probeVP * vec4(wp.xyz, 1.0);
|
||||
vec2 tc = (pp.xy / pp.w) * 0.5 + 0.5;
|
||||
#ifdef HLSL
|
||||
tc.y = 1.0 - tc.y;
|
||||
#endif
|
||||
|
||||
vec2 enc = g0.rg;
|
||||
vec3 n;
|
||||
|
|
|
@ -172,7 +172,7 @@ class Inc {
|
|||
// Resize shadow map
|
||||
var l = path.light;
|
||||
if (l.data.raw.type == "sun" && l.data.raw.shadowmap_size != config.rp_shadowmap_cascade) {
|
||||
l.data.raw.shadowmap_size = config.rp_shadowmap;
|
||||
l.data.raw.shadowmap_size = config.rp_shadowmap_cascade;
|
||||
var rt = path.renderTargets.get("shadowMap");
|
||||
if (rt != null) {
|
||||
rt.unload();
|
||||
|
@ -180,7 +180,8 @@ class Inc {
|
|||
}
|
||||
}
|
||||
else if (l.data.raw.shadowmap_size != config.rp_shadowmap_cube) {
|
||||
rt = path.renderTargets.get("shadowMapCube");
|
||||
l.data.raw.shadowmap_size = config.rp_shadowmap_cube;
|
||||
var rt = path.renderTargets.get("shadowMapCube");
|
||||
if (rt != null) {
|
||||
rt.unload();
|
||||
path.renderTargets.remove("shadowMapCube");
|
||||
|
|
|
@ -675,7 +675,6 @@ class RenderPathDeferred {
|
|||
path.drawShader("shader_datas/deferred_light/deferred_light_VoxelAOvar") :
|
||||
path.drawShader("shader_datas/deferred_light/deferred_light");
|
||||
#end
|
||||
path.setDepthFrom("tex", "gbuffer0"); // Re-bind depth
|
||||
|
||||
#if rp_probes
|
||||
if (!path.isProbe) {
|
||||
|
@ -685,6 +684,7 @@ class RenderPathDeferred {
|
|||
if (!p.visible || p.culled) continue;
|
||||
path.currentProbeIndex = i;
|
||||
path.setTarget("tex");
|
||||
path.bindTarget("_main", "gbufferD");
|
||||
path.bindTarget("gbuffer0", "gbuffer0");
|
||||
path.bindTarget("gbuffer1", "gbuffer1");
|
||||
path.bindTarget(p.raw.name, "probeTex");
|
||||
|
@ -698,6 +698,8 @@ class RenderPathDeferred {
|
|||
}
|
||||
#end
|
||||
|
||||
path.setDepthFrom("tex", "gbuffer0"); // Re-bind depth
|
||||
|
||||
// #if rp_volumetriclight
|
||||
// {
|
||||
// path.setTarget("bufvola");
|
||||
|
|
|
@ -25,6 +25,8 @@ def make(context_id):
|
|||
frag.main = frag.main[:frag.main.rfind('fragColor')]
|
||||
|
||||
frag.write('\n')
|
||||
frag.add_uniform('vec3 lightColor', link='_lightColor')
|
||||
frag.write('float visibility = 1.0;')
|
||||
frag.write('vec4 premultipliedReflect = vec4(vec3(direct * lightColor * visibility + indirect * occlusion) * opacity, opacity);')
|
||||
|
||||
frag.write('float fragZ = wvpposition.z / wvpposition.w;')
|
||||
|
|
Loading…
Reference in a new issue