Dark Bit Factory & Gravity

GENERAL => Projects => Topic started by: Optimus on December 27, 2011

Title: Fun GLSL Sandbox multiple effects screen
Post by: Optimus on December 27, 2011
Ok,. if you know http://glsl.heroku.com and can code shaders go there it's fun. Galleries of funny things, lot's of inspiration.

I decided instead of trying to code a single effect to make screen compartmentalisation and do a crazy shit with many effects calculated in a single shader code all at once. I was coding this crazy thing for 3 days. Still fast enough in my GTS 450 GeForce. I can't believe I finished this and the shader code didn't reach memory limitations yet :)

http://glsl.heroku.com/e#886.0 (zoomer mode)
http://glsl.heroku.com/e#888.0 (rotozoomer mode)
Title: Re: Fun GLSL Sandbox multiple effects screen
Post by: ttemper on December 27, 2011
Very cool. Ran nice and smooth here also, I'm running a 1gig GT440 card.

Something I plan to learn later on once I get some Freebasic learning under my belt. Definitely interested in using glsl in with tinyptc_ext to get some nice effects happening for demos.

Title: Re: Fun GLSL Sandbox multiple effects screen
Post by: Kirl on December 27, 2011
I can't code shaders but this looks absolutely fantastic, so I wish I could! Excellent work!

Really impressive number of different and beautifull effects! And all running together smoothly. Love the way it's presented as well with the code in the foreground, looks like a pretty rocking site!


I only know the term "shader" from 3d dev where they're sort of a 2d surface material to wrap around the model, are these the same shaders? Where should I start reading up on these?




Title: Re: Fun GLSL Sandbox multiple effects screen
Post by: benny! on December 27, 2011
Great site.And those fragment/pixelshaders are pretty cool to port to TinyC5 (although the speed of glsl is way better of course).
Title: Re: Fun GLSL Sandbox multiple effects screen
Post by: Optimus on December 27, 2011
I can't code shaders but this looks absolutely fantastic, so I wish I could! Excellent work!

Really impressive number of different and beautifull effects! And all running together smoothly. Love the way it's presented as well with the code in the foreground, looks like a pretty rocking site!


I only know the term "shader" from 3d dev where they're sort of a 2d surface material to wrap around the model, are these the same shaders? Where should I start reading up on these?

The fragment shaders gives you the ability to describe with a programm how to calculate the colors of each pixel of the polygons send to render in the 3d card. So, instead of the common functions to shade and texture polygons your own fragment shader programm takes control. You have some information like 3d coordinates of the single pixel of the surface to render, the interpolated texture coordinates or normals and some more stuff. So knowing all these information per pixel you can write your own per pixel lighting algorithm, with phong or bump mapping or anything else, or even 2d procedural effects running on the surface. Also, the shader have a different logic than in software rendering, your program describes what happens for each separate pixel (in reality it's fragment which is something similar to pixel but I refer it as pixel for simplicity) and so you don't have to do a double X,Y loop. Which is cool as a concept but some effects that need to know the values of near pixel in the framebuffer are harder to do.

The fun though with the glsl sandbox is that you can't define the geometry. It gives you a quad that fits exactly the screen with pixel (fragment) coordinates and you can't easilly do 3d stuff with the traditional way. Even the 2d need an alternative way to be rendered. For example, having this 2d information I could do these tunnel and floor map in one of the effects but I am not provided with a texture so I had to procedurally generate it during the rendering. The more fun and puzzling for some would be how did someone draw several different blobs, raster bars, separetely moving objects like in my example. For example if I have 32 blob stars in one of the screens, for each pixel I recalculate the positions of the 32 blobs so that I add the blob energies to get the energy for this pixel. The alternative would be to calculate them once per frame in the CPU and send them as varying variables but here you do this thing again and again for each pixel wasting processing time for stupid reasons (but it's the only way to do it here with just the shader code provided and it's quite bruteforce). It's amazing though how many unecessary things per pixel are these shaders doing and yet how well the modern 3d hardware can handle this.

Anyway, it's hard to explain. For some things I had to invent different ways of doing some of the effects than the way I was used to work with software rendering. Some of the other examples on the GLSL sandbox site makes you wonder how the hell were they done.
Title: Re: Fun GLSL Sandbox multiple effects screen
Post by: Kirl on December 28, 2011
Thanks for the explanation Optimus!
Really impressed by the quality of all the individual effects, the plasma bump and weird liquid like stuff are especially cool.

Roxxors!  ;D
Title: Re: Fun GLSL Sandbox multiple effects screen
Post by: Shockwave on December 28, 2011
I really like that Optimus, it looks really cool when it zooms in and the green 3D starfield looks especially nice!
Title: Re: Fun GLSL Sandbox multiple effects screen
Post by: Raizor on December 30, 2011
Neat idea Optimus, looks very cool :) I'm surprised at how smooth it is.
Title: Re: Fun GLSL Sandbox multiple effects screen
Post by: energy on December 30, 2011
Wow Great Site.. Thanx.....
Worked for my old NV7950GT with Chrome after installing the newest drivers...