Then for each pixel it runs a pixel shader. Traditionally to draw a sphere you generate some 3D geometry, send this to the GPU as a vertex buffer (importantly, this will never be a sphere, just an approximation, as it will have to consist of a finite number of triangles) the GPU then runs a vertex shader for each vertex in the geometry, and generates fragments (pixels). It looks like it, but all I'm doing is drawing a sprite (so a plain, flat square) with a clever shader that does a bit of maths, and makes it look like a rotating sphere in a 3D world. Now the interesting bit is that this is not, by any means, a 3D object. I mean, how could you not be excited about this? Look at it (and move the mouse around the planet to change the lighting). Something along the lines of "hmmm, seriously?". Their reactions were a bit less than enthusiastic. I casually asked my wife and a couple of other people if they thought it would make a good first blog post that people would find interesting and exciting. One of the topics that I find really fascinating is using shaders to fake 3D objects and lighting in a 2D world. We have a shiny new blog, so I thought I would post something cool and interesting to get it started.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |