u(t) is called 60 times per second.
t: Elapsed time in seconds.
S: Shorthand for Math.sin.
C: Shorthand for Math.cos.
T: Shorthand for Math.tan.
R: Function that generates rgba-strings, usage ex.: R(255, 255, 255, 0.5)
c: A 1920x1080 canvas.
x: A 2D context for that canvas.
Thanks guys :) I have time to outline the pseudo radiance/GI concept at least: Each pixel's ray reflects once after the 1st intersection with the scene. All rays reflect in the same pre-defined direction, in parallel with each other, and roughly towards the light source but not collinear with it i.e not directly in line. The distance between the 2nd intersection (reflected ray end position) and the light source position, is used to estimate luminance.
This is not physically accurate or intuitive, but is similar in concept to ambient occlusion where single bounce rays are used to estimate luminance based on "exposure" to ambient light. However unlike AC we can only afford a single ray, so we take that single ray and bounce it in a *similar* direction to the light source and see what we hit (what occludes the ray in that direction, which is why we get directional shading). The closer the 2nd intersection is to the light source the greater the luminance should be as a kind of bad proxy of "is exposed to a (probably?) bright surface".
The reason we don't simply use the length of the reflected portion of the ray, is because although it does yield occlusion effects, the light position is inconsistent and parallel surfaces are flat and unconvincing because the reflected ray lengths are the same. So by making the light source and reflection ray not quite collinear, the distance between those 2nd intersections and the light source follows a gradient for parallel surfaces, causing more convincing shading... At least that's what I think is happening! I doubt this has good scene adaptability though, probably just a demo algorithm :D
Also for some reason I'm quite happy with /R, super short poor mans anisotropic texture filter :P just fading out and letting lighting take over the further away the surface.
I'm not understand! 𩡯𬠨𭰽𨰮𭱩𩁴𪀦👩🐱𝠸🐨𦀦𦠩🀳🀲𞡒𝐺𤠡👔𮀮𩡩𫁬𤡥𨱴𛁩🠾𝁥𝐯𞀩𝐬𭐥𝠯𝠯𤠩𞠨𭐽𦐼𧠲𞡙𝠿𝐺𭰫𦀪𦐪𝑞𦠪𥀫𦀽𪐥𭰯𝠴𛁙👩𛰴𩐳𛁚👴 How? Your have unicode generator?
u(t) is called 60 times per second.
t: elapsed time in seconds.
c: A 1920x1080 canvas.
x: A 2D context for that canvas.
S: Math.sin
C: Math.cos
T: Math.tan
R: Generates rgba-strings, ex.: R(255, 255, 255, 0.5)