View previous topic :: View next topic |
Author |
Message |
Electro
Joined: 29 Dec 2004 Posts: 241 Location: Brisbane, Australia
|
Posted: Sat Dec 13, 2008 11:30 pm Post subject: Tutorial Request: Adding GLSL support |
|
|
I think it'd help push Quake graphics in the direction they need to go. Rather than coding newer effects in the engine, shaders is the way of the future (or current, really).
I know Darkplaces has it, and that's great (although I haven't looked into what extent it supports them, I'm guessing quite extensively). I'm interested in writing some shaders, and would like for more engines to be able to use them.
The cliche shader for me to start on first would be liquids (water and lava won't be the same shader because well.... they're different! Same for slime).
Anyway... I'd love it if someone could write a tutorial on how to implement this in engines so any work I do on glsl shaders can be more widely spread. _________________ Unit reporting!
http://www.bendarling.net/ |
|
Back to top |
|
 |
MeTcHsteekle
Joined: 15 May 2008 Posts: 397 Location: its a secret
|
Posted: Sat Dec 13, 2008 11:37 pm Post subject: |
|
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaand adding CSQC toengine ":D? _________________ bah |
|
Back to top |
|
 |
scar3crow Inside3D Staff

Joined: 18 Jan 2005 Posts: 837 Location: Las Vegas, NV
|
Posted: Sat Dec 13, 2008 11:43 pm Post subject: |
|
|
Quote: | The cliche shader for me to start on first would be liquids (water and lava won't be the same shader because well.... they're different! Same for slime). |
Don't forget the muddy water, its not on par with the whiteish blue or the deep blue water in terms of the physical material.
I'd like to see one for various stained glass textures... _________________ ...and all around me was the chaos of battle and the reek of running blood.... and for the first time in my life I knew true happiness. |
|
Back to top |
|
 |
MeTcHsteekle
Joined: 15 May 2008 Posts: 397 Location: its a secret
|
Posted: Tue Mar 24, 2009 9:48 pm Post subject: |
|
|
/ bumps on the GLSL _________________ bah |
|
Back to top |
|
 |
Irritant
Joined: 19 May 2008 Posts: 115 Location: Maryland
|
Posted: Mon Mar 30, 2009 4:40 pm Post subject: |
|
|
MeTcHsteekle wrote: | / bumps on the GLSL |
There are a number of engines now using GLSL. It's not really that hard to do once you get the hang of it. The problem I ran into wasn't so much GLSL, but trying to figure out how it was used in engines like DP and some others due to the renderer being rewritten in a way that was unfamiliar to me, and very different looking than the original source. Your best bet is buying the Orange Book, and also downloading tutorials.
You could also look at CRX(Alien Arena engine) source http://svn.icculus.org/alienarena
We make use of GLSL on bsp surfaces(including water) as well as mesh for normal, parallax, and specular, and the code is still structured similarly enough to Q2 that it's not hard to figure out or transpose into another quake engine.
An simple light test map, just a box here of the recently added mesh shaders:
static light
dynamic light
Still working on it some, but so far so good. _________________ http://red.planetarena.org - Alien Arena |
|
Back to top |
|
 |
reckless
Joined: 24 Jan 2008 Posts: 390 Location: inside tha debugger
|
Posted: Sun Apr 05, 2009 4:25 am Post subject: |
|
|
pretty cool
unfortunatly i ran headfirst into a wall when i tried to get the glsl shaders working on realm cause it uses some nasty trickery to do dual layer water to simulate a fragment shader. i got a feeling i will have to rewrite a ton of stuff to get this working erf :/.
mh's code uses a ton of matrix operations to do the nifty stuff and it looks good but damn its anoying when you try to add something like this hehe  |
|
Back to top |
|
 |
mh

Joined: 12 Jan 2008 Posts: 909
|
Posted: Sun Apr 05, 2009 1:20 pm Post subject: |
|
|
I think the problem with GLSL is that it's not something that's easily tutorialized. You can't just put a GLSL tutorial into an engine and then expect to be able to do cool bumpy specular reflective stuff straight away on everything; a lot of it is dependent on the data that your engine hands over to the shaders, how your rendering passes are structured and so on. That's a lot of work before you even start writing shaders! All that GLSL does is (over-simplified explanation ahoy!) intercept the standard glVertex/glNormal/glColor/glTexCoord/etc calls and let you replace the canned behaviour of them with your own.
Rather than a GLSL Quake tutorial, if you're interested in learning it, you're much better off grabbing a "spinning cube" program and working on that. _________________ DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines |
|
Back to top |
|
 |
reckless
Joined: 24 Jan 2008 Posts: 390 Location: inside tha debugger
|
Posted: Fri Apr 10, 2009 11:17 am Post subject: |
|
|
so much i got
to my understanding its a script interface to what you explained letting us override vertex data etc.
quite nice but yes hard to implement if your not savy in it.
just looking at the mess of code tenebrae uses for as little as it actually shows in terms of visuals makes my head spin and want me to jump of the nearest bridge (preferably a large one)  |
|
Back to top |
|
 |
Entar

Joined: 05 Nov 2004 Posts: 422 Location: At my computer
|
Posted: Fri Apr 10, 2009 11:28 pm Post subject: |
|
|
mh wrote: | I think the problem with GLSL is that it's not something that's easily tutorialized. You can't just put a GLSL tutorial into an engine and then expect to be able to do cool bumpy specular reflective stuff straight away on everything |
That's true. However, I think it would not be terribly difficult to write a tutorial for GLSL support in GLQuake - you mostly just have to load in the function pointers and have a good function for loading fragment/vertex shaders. Making it work for you beyond that is definitely going to be more complicated though. Maybe to get things started, it could be something for a post-processing shader on the screen, and make it turn everything black and white or something. _________________ woh... feelin woozy... too much cider...
http://entar.quakedev.com
games fascination - My Game Development Blog/Journal
 |
|
Back to top |
|
 |
|