Inside3D!
     

Tutorial Request: Adding GLSL support

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
Electro



Joined: 29 Dec 2004
Posts: 241
Location: Brisbane, Australia

PostPosted: Sat Dec 13, 2008 11:30 pm    Post subject: Tutorial Request: Adding GLSL support Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
MeTcHsteekle



Joined: 15 May 2008
Posts: 397
Location: its a secret

PostPosted: Sat Dec 13, 2008 11:37 pm    Post subject: Reply with quote

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaand adding CSQC toengine ":D?
_________________
bah
Back to top
View user's profile Send private message AIM Address
scar3crow
Inside3D Staff


Joined: 18 Jan 2005
Posts: 837
Location: Las Vegas, NV

PostPosted: Sat Dec 13, 2008 11:43 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
MeTcHsteekle



Joined: 15 May 2008
Posts: 397
Location: its a secret

PostPosted: Tue Mar 24, 2009 9:48 pm    Post subject: Reply with quote

/ bumps on the GLSL
_________________
bah
Back to top
View user's profile Send private message AIM Address
Irritant



Joined: 19 May 2008
Posts: 115
Location: Maryland

PostPosted: Mon Mar 30, 2009 4:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
reckless



Joined: 24 Jan 2008
Posts: 390
Location: inside tha debugger

PostPosted: Sun Apr 05, 2009 4:25 am    Post subject: Reply with quote

pretty cool Very Happy

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 Wink
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Sun Apr 05, 2009 1:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
reckless



Joined: 24 Jan 2008
Posts: 390
Location: inside tha debugger

PostPosted: Fri Apr 10, 2009 11:17 am    Post subject: Reply with quote

so much i got Wink

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) Laughing
Back to top
View user's profile Send private message
Entar



Joined: 05 Nov 2004
Posts: 422
Location: At my computer

PostPosted: Fri Apr 10, 2009 11:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group