There are currently 110 players online.
 
Warsow


 
 

backGLSL Shaders

Posted by
Post Scroll to bottom
uunx
Member
(5 posts)

What's the best way to go about implementing GLSL shaders with the Warsow source?

Do they need to be hardcoded in r_program.c or can they be loaded from the game directory? I'm having trouble understanding how it works, when I've used GLSL before it was with the source engine and it was a simple case of compiling the shader and using it as a material. It appears to be more complex within Warsow. Any help appreciated, thanks.

MagusZero
Chaotician
(1858 posts)

Hold on... GLSL is opengl afaik; the source engine in opengl isn't out yet?

uunx
Member
(5 posts)

It uses HLSL, but as far as I understand it's basically the same thing? But I think the Source Shader Editor's custom code allows you to import GLSL as well.

Vic

Member
(4892 posts)

In Warsow, all shaders are stored as constant strings in r_program.c

Each shader can have a number of permutations which are controlled by various bitflags, which are then converted into GLSL preprocessor #defines

It should be fairly simple to implment an external loader for GLSL shaders but I wanted to keep them hardcoded for maliciious reasons :P

uunx
Member
(5 posts)

I'm a little confused here, from the GLSL shaders in r_program it appears to use vertex shaders and fragment shaders. I'm trying to apply a post process effect to the whole screen (as if it was one 2d flat image), excluding the HUD/crosshair. How should I go about doing this?

Edit: From what I remember (from HLSL), it's something about rendering the full screen to a quad and applying the effect to that? No idea how I'd go about doing this though. Is there anything in place already to make it simpler?
(updated 2012-09-10 23:02:31)

Vic

Member
(4892 posts)

No, there's no builtin framework for that. You'll have to exactly the way you described: render the screen to a framebuffer with texture attached and then render a quad with your special fx applied (utilizing your custom program from r_program.c)

uunx
Member
(5 posts)

Alright, thanks a lot I'll give it a go.

clownfart

aka simon
(1024 posts)

Make sure to keep us updated on your work. :D

uunx
Member
(5 posts)

I'm still having difficulty with this. I sort of understand the general process and I've read up about some shaders and opengl etc but I haven't been able to get it to work myself.

Is someone willing to help out with this? I think I've given it the best attempt I can and I don't seem to be getting anywhere. I don't really have a background in coding and this specific task isn't the main part of the project I'm working on, so really I'm looking for a quick solution.

Or maybe if someone can describe the process in a specific way (what/where things would need to be added) so I have a better idea?

Thanks for any help & the help so far.

heretic

Member
(43 posts)

I've been doing a little work with GLSL in the Qfusion engine. I'll be around this weekend in #warsow.na on quakenet if you need a second pair of eyes.

adem

Группа ВКонтакте vk.com/wsw_ru
(1299 posts)

#warsow at irc.quakenet.org was the best way to connect with the developers.
(updated 2012-09-28 21:27:30)

crizis

Mad Hatter
(4081 posts)

adem wrote:
#warsow at irc.quakenet.org is the best way to connect with the developers.


Not really.. no devs left there :]

adem

Группа ВКонтакте vk.com/wsw_ru
(1299 posts)

fixed:
adem wrote:
#warsow at irc.quakenet.org was the best way to connect with the developers.

(updated 2012-09-28 21:28:12)


Scroll to top



RSSRSSRSSRSS

Copyright © 2013 Chasseur De Bots

Warsow in social media



Warsow is an indie game developed by group of hobbyists. Please consider giving us a small donation: