Crist-JRoger
|
|
« Reply #225 on: January 17, 2017, 11:06:04 AM » |
|
Oh, no no no ) i specifically drew attention to this: I'm not meaning that lightray will reflect from surface and goes again in space (it sounds fantastic for free soft). I mean just displaying ray on reflecting surface (1st and 3rd pictures on prev.post). But(!) sometimes lightrays not reflected (2nd pic). So, one reason that we see differents - camera was mooved or FOV was changed.
|
|
|
Logged
|
|
|
|
lycium
|
|
« Reply #226 on: January 17, 2017, 11:08:38 AM » |
|
Ah sorry, should have paid more careful attention
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #227 on: January 17, 2017, 11:23:52 AM » |
|
It's ok. So, that's why question to Knighty, he wrote this ) Based on Kali's vol.light, but he lost somewhere... If you could sort out in DE-Kn2.frag, will be great )
|
|
|
Logged
|
|
|
|
knighty
Fractal Iambus
Posts: 819
|
|
« Reply #228 on: January 18, 2017, 12:04:05 PM » |
|
It is very simple. There is a rather dumb "optimisation" that causes bright features to be not reflected at all: In DE-Kn*.frag, in color() function, about the end you have this test: if (hitNormal == vec3(0.0) || dot(RWeight,RWeight)<0.0001 || lighthit || Ray.Pos>=MaxDistance) {//nothing hit or light hit or reflected light is too small break; } The problem comes from: ... dot(RWeight,RWeight)<0.0001 ... The solution should be to remove that condition or to set the right hand side to a (much) smaller value. In some way, it is related to what lycium was explaining: It is very difficult (if possible) to say in advance how much light a ray carries.
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #229 on: January 18, 2017, 12:41:10 PM » |
|
... dot(RWeight,RWeight)<0.0001 ... Thank you! ) As i remember you wrote this for good reason. Black dots or some optimisations...
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #230 on: January 18, 2017, 05:51:07 PM » |
|
Looked. Not helps. Maybe another reason for this behavior? Straight ray on first plane, but behind in reflection :- Attached frags.
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #231 on: January 20, 2017, 12:35:19 PM » |
|
Found some way to go (maybe good results). Added line colfogglow+=ptLightGlow1(prevPos, curPos); here #ifdef KN_VOLUMETRIC if(HF_Scatter*(HF_Intensity+HF_Const)>0.){ vec3 colfogglow=vec3(0.); for(int j=0;j<HF_FogIter;j++) { colfogglow+=ptLightGlow1(prevPos, curPos); colfogglow+=ptLightGlow3(prevPos, curPos); } col0+=colfogglow*1./float(HF_FogIter);//ptLightGlow1(prevPos, curPos); } #endif So there is more rays on reflection, but still missed pieces (1,2) and excess rays too (3) upd.: I think (3) it's a reflection on the ceiling upd.2: This looks better. Am i on a right way? :- colfogglow+=ptLightGlow1(prevPos, curPos); colfogglow+=ptLightGlow1(prevPos, curPos); colfogglow+=ptLightGlow3(prevPos, curPos);
|
|
« Last Edit: January 20, 2017, 01:36:24 PM by Crist-JRoger »
|
Logged
|
|
|
|
knighty
Fractal Iambus
Posts: 819
|
|
« Reply #232 on: January 20, 2017, 05:45:09 PM » |
|
OK, sorry! my bad. It is a bug that was really hard to spot. Thank you for reporting it. #ifdef KN_VOLUMETRIC if(HF_Scatter*(HF_Intensity+HF_Const)>0.){ fogstrata=0;// <<<---- ADD THIS vec3 colfogglow=vec3(0.); for(int j=0;j<HF_FogIter;j++) colfogglow+=ptLightGlow3(prevPos, curPos); col0+=colfogglow*1./float(HF_FogIter);//ptLightGlow1(prevPos, curPos); } #endif "fogstrata" have to be set to 0 at each reflexion. Otherwise, in ptLightGlow3(p0,p1) the sample points won't be completely inside the segment (p0,p1).
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #233 on: January 20, 2017, 07:44:26 PM » |
|
Thank you! Great render and nodody saw this bug until recently
|
|
|
Logged
|
|
|
|
Sabine
|
|
« Reply #234 on: January 20, 2017, 07:53:30 PM » |
|
|
|
|
Logged
|
sabine62.deviantart.com
|
|
|
|
Tim Emit
|
|
« Reply #236 on: January 24, 2017, 09:45:20 AM » |
|
@ Crist Someone dropped all their paper notes and those kindly god rays are lighting up where they are : )
|
|
|
Logged
|
|
|
|
Crist-JRoger
|
|
« Reply #237 on: January 24, 2017, 11:28:49 AM » |
|
Like this? ) Only vol.light and reflections
|
|
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #238 on: January 28, 2017, 08:44:54 AM » |
|
Icecapades?
|
|
|
Logged
|
|
|
|
|