This is sort of the tutorials that doesn't make any sense if you are not already knowledgeable in the subject of math and shaders and rendering basics. At first I was hopeful that it would finally walk me though the basics of a renderer and explain the concepts behind it, but I was let down :)
I have so many questions regardless :) The struggle of a rookie goes as:
SECTION A
- why on earth do you take the square root of c? Is there a sane reason to do this?
SECTION B
- why normalize the vector? I'd love to see a detailed explanation.
- why is vPos.xy the first two parameters?
- is vPos.xy a constant value or is it evaluating as the shader script is executed pixel by pixel?
SECTION D
- V -= S.xyz; // what's going on here? Why use the -= operator? Is this something to do with the way shaders operate?
- float B = 2. * dot(V, W); // what take the dot product?
- float C = dot(V, V) - S.w * S.w; // Why take it again and substract a square?
- return BB < 4. C ? 0. : 1.; // Why 4.? No other value seems to work
SECTION E
- "Improve raytrace to return distances of near and far roots." OK I admit that I'm totally lost at this point. Asking line-by-line explanation doesn't really help :)
SECTION H
- YAY, sin and cos!!! Finally I can mess around with something :)
I have so many questions regardless :) The struggle of a rookie goes as:
SECTION A
- why on earth do you take the square root of c? Is there a sane reason to do this?
SECTION B
- why normalize the vector? I'd love to see a detailed explanation. - why is vPos.xy the first two parameters? - is vPos.xy a constant value or is it evaluating as the shader script is executed pixel by pixel?
SECTION D
- V -= S.xyz; // what's going on here? Why use the -= operator? Is this something to do with the way shaders operate? - float B = 2. * dot(V, W); // what take the dot product? - float C = dot(V, V) - S.w * S.w; // Why take it again and substract a square? - return BB < 4. C ? 0. : 1.; // Why 4.? No other value seems to work
SECTION E
- "Improve raytrace to return distances of near and far roots." OK I admit that I'm totally lost at this point. Asking line-by-line explanation doesn't really help :)
SECTION H
- YAY, sin and cos!!! Finally I can mess around with something :)