General Category > General Anim8or Forum
WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)
cooldude234:
A quick look at what Graphics Library Shading Language (GLSL) is.
Basically it's a bunch of code that runs on the graphics card and overrides how things are drawn on screen :P
I know, I know, I'm the greatest teacher in the world. No need for an applause ::)
There are two main important parts to GLSL that one needs to know, Vertex shaders, and Fragment shaders
(there's also geometery shaders for more specific gemeotry stuff, but not bothering with those yet).
-Vertex shaders is what handles the points that make up the geometry.
-Fragment shaders is what handles the individiual pixels that are drawn between the vertices that make up the polygons.
Now with that out of the way...
So I decided on how GLSL will be implemented.
I'm going to make it so that the user can write using GLSL code directly (so that way using any GLSL code from the internet or other sources will work pretty much all the same) with the added benefit of my scripting language tied right in.
Hopefully this way I can make some functions for shaders specifically in so that it can make it easier to program.
For example, a normal vertex shader in GLSL would look like this.
--- Code: ---void main(void)
{
gl_Position = gl_Vertex * gl_ModelViewProjectionMatrix;
}
--- End code ---
How GLSL shaders could look with functions from my engine.
--- Code: ---void main()
{
Pos = VertexPos;
}
--- End code ---
Simply I would just parse through the shader when loading it and when I come across one of my functions I would then change it around so that GLSL could read it like normal.
So Pos = VertexPos; would then be changed to gl_Position = gl_Vertex * gl_ModelViewProjectionMatrix; making it easier to read and write if your not used to such stuff. But even better this then allows me to follow the same naming convention style as the rest of the scripting language. And as well I'm going to allow the full standard GLSL functionality so if you want to handle it that way you can!
cooldude234:
Oh yea, and this is what happens when you accidentally multiply one variable in a shader :P
cooldude234:
And some long awaited (I hope :P) screen shots.
Basically just showing off some really simple stuff you can do with shaders.
More importantly there is now a much much better contrast and brightness control instead of the old method I had which used a rather brute force workaround method using blending functions with quads being render to the scene in front of the camera.
EDIT: Apparently this was my 700th post, didn't realize I had made that many lol
cooldude234:
Alrighty, I haven't been able to give much of an update as I have been taking a lot of time to make the code much better and doing stuff that you can't so visually see, such as variable creation on the fly!
Yes that's right, you can now script in variables; and considering that scripts aren't compiled they're just read in real-time by the parser that technically means you can define variables whenever! This gave me an idea of having a script editor that you can edit while running your application (however that is just an idea, nothing said in stone about that). So far you can define a integer! WOO! but the ground is there for others.
Now because Steve decided to add shaders to anim8ors preview render (the opengl workspace) I decided to get on my lazy butt and program in some lights! So now we have screenies to share. Yup that means there are now technically shaded lights (mostly just ground work again :P)
EDIT: 3rd image has some bad normals in it, that's due to my obj loader or anim8ors exporter, I still haven't found the issue of it (not like I looked very well into it :P) but the image shows a good amount of detail the lighting can do.
cooldude234:
Real-time audio now works (even though you can't play an audio clip longer than the buffer as it gets cut off).
Nuff said :P
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version