Rendering my (billiard) balls in a fragment shader
61–70 of 88 posts
Re: Rendering my (billiard) balls in a fragment shader
#62From the HN guidelines: please use the original title, unless it is misleading or linkbait; don't editorialize. The correct title is Rendering Pool Balls , not "Rendering my balls in a fragment shader".
Fixed.
(For anyone wondering: the submitted title was "Rendering my balls in a fragment shader" and the article title was changed from "Rendering pool balls" to that.)
Re: Rendering my (billiard) balls in a fragment shader
#63From the HN guidelines: please use the original title, unless it is misleading or linkbait; don't editorialize. The correct title is Rendering Pool Balls , not "Rendering my balls in a fragment shader".
Re: Rendering my (billiard) balls in a fragment shader
#64I'm just getting my feet wet with shaders myself. Could this fragment shader be used in a "real" 3D game? At the moment, the sphere is orthographicly projected onto the screen so the sphere will always appear as a circle rather than an ellipse. How easy would it be to use this shader in place of a spherical mesh as you might find in a typical geometry based 3D render? I.e. could you use the same technique and render…
It can be incorporated into a 3D scene as long as you can make a square billboard . You may have problems with clipping that' you need to address manually, but it might be worth it as you can get better visuals, assuming you are trying to render spheres. As far as I know there shouldn't be any distortion issues. A sphere will always look like a circle from any perspective. Well that is unless it's really really big o…
Re: Rendering my (billiard) balls in a fragment shader
#65Earlier quoted context omitted.
Lol, wow what a find. You notice the details. I corrected it. Thank you.
At school, I somehow talked myself into a dumb competition with my math geek about memorizing digits of pi. I won, with 35 digits memorized (he gave up early; that's also around where the first '0' occurs in pi). I don't miss any opportunities to test that I still remember them correctly, to this day. ;)
But these days I would rather memorize tau:
6.28318530717958647692528676655900576839433879875021
It has that "00" at 27 digits in that must be got past.Re: Rendering my (billiard) balls in a fragment shader
#66Earlier quoted context omitted.
Cool, I recently started with GLSL, and it’s interesting there are many roads that lead to a similar solution (how I draw circles or make a center is tad different) Where or how did you learn GLSL?
I was around and writing OpenGL when we started getting the first programmable cards. Nvidia shot out first with their Cg language, but I held back and waited for the "Orange Book" to come up. I bought it right away and learned from it and by looking at other peoples shaders. https://duckduckgo.com/?q=opengl+orange+book Also the quick reference card helps https://duckduckgo.com/?q=glsl+quick+reference&t=h_&ia=web
The resources are really good, hadn’t found something like that yet!
Re: Rendering my (billiard) balls in a fragment shader
#67I happened to notice that PI is #define'd to 3.1415926538, which isn't the correctly rounded off value of 3.14159265358... Seems like they missed a '5'.
Interesting point if it had been apparent it would have been an issue, at what point does a poor Pi become an issue? What would a Pi of 3.0 do?
- https://en.wikipedia.org/wiki/Indiana_Pi_Bill
- https://www.straightdope.com/21341975/did-a-state-legislatur...
Re: Rendering my (billiard) balls in a fragment shader
#68I happened to notice that PI is #define'd to 3.1415926538, which isn't the correctly rounded off value of 3.14159265358... Seems like they missed a '5'.
Interesting point if it had been apparent it would have been an issue, at what point does a poor Pi become an issue? What would a Pi of 3.0 do?
Re: Rendering my (billiard) balls in a fragment shader
#69Here is the only image I could find of the RenderMan Shading Language VIDI SPORTS SHADERS Makina Works sold at the time (you got no source, just bytecode understood by Pixar's implementation at the time, AFAIK):
https://web.cs.wpi.edu/~matt/courses/cs563/talks/renderman/S...
What is interesting here is that the shaders did everything on a sphere primitive. All RenderMan implementations at the time (there were more than just Pixar's) were micropolygon renderers. I.e. displacement was almost free in terms of compute overhead.
Even the football operated on a sphere that the shader deformed into the resp. shape. All patterns, stripes etc. were procedurally generated. Each shader had texture slots to apply custom logos.