Fix ndc vector

This commit is contained in:
luboslenco 2019-02-19 17:11:33 +01:00
parent 048bbaad6e
commit 0bed1fcda6
2 changed files with 3 additions and 3 deletions

View file

@ -53,7 +53,7 @@ float getDeltaDepth(vec3 hitCoord) {
void rayCast(vec3 dir) {
hitCoord = vpos;
dir *= ssgiRayStep * 2;
float dist = 0.1;
float dist = 0.15;
for (int i = 0; i < ssgiMaxSteps; i++) {
hitCoord += dir;
float delta = getDeltaDepth(hitCoord);

View file

@ -130,7 +130,7 @@ class Cycles {
if (frag.bposition) {
vert.add_out('vec3 bposition');
if (frag.ndcpos) {
vert.write('bposition = ndc.xyz;');
vert.write('bposition = (ndc.xyz / ndc.w);');
}
else {
vert.add_uniform('vec3 dim', '_dim');
@ -155,7 +155,7 @@ class Cycles {
if (frag.mposition) {
vert.add_out('vec3 mposition');
if (frag.ndcpos) {
vert.write('mposition = ndc.xyz;');
vert.write('mposition = (ndc.xyz / ndc.w);');
}
else {
vert.write_attrib('mposition = pos.xyz;');