Development > Coding

Shadersupport

(1/4) > >>

oxyXen:
Hi

I could take some work on shadersupport and shaders in a few days. What shaders should the project have[assembler|Cg|GLSlang].
As i messed around with shaders, i needed the glew library and devs. These were assemblercode-shaders.
For Cg the Cg-libs would be needed, which are not in the kubuntu deposit afaik.

ox

Hoehrer:

--- Quote from: "oxyXen" ---I could take some work on shadersupport and shaders in a few days. What shaders should the project have[assembler|Cg|GLSlang].
As i messed around with shaders, i needed the glew library and devs. These were assemblercode-shaders.
For Cg the Cg-libs would be needed, which are not in the kubuntu deposit afaik.
--- End quote ---


I do not know much about the different shader languages [1], but in any case i suggest to choose the one that is the most-supported and _open_ language.

Maybe looking into the other opened quake2-engines [2] (UFO:AI was based on the opensource'd Q2 engine) will save us alot of effort, since they might already have shader-support.

Werner

[1] I think there are some more out there than you mentioned?
[2] There already was a discussions about integrating changes from another quake2-engine project into this... fogot the name. MAybe it supports shaders already.

Mattn:
have a look at gl_arb_shaders.c in ref_gl directory. maybe it's a start.
some will cry that we don't need shaders but gameplay.....
imo we need shaders, too - so stop crying.

would be cool to have shaders - for water and stuff like this.

oxyXen:
Ah, thanx mattn

Who wrote this, id?
Is it used in q2-3.20?

Hehe, in this file the last func has a false name (imho), bindblabal would be better.

Well this file gives some shader support for assembler shaders. Pretty the same as i used in my engine. I can live with that and tage a deeper look in.


--- Quote ---I do not know much about the different shader languages [1], but in any case i suggest to choose the one that is the most-supported and _open_ language.
--- End quote ---


The arbfp1 and arbvp1 are not that easy to read, of course, but are right now the easiest way. Internally we can write the shaders in Cg and then compile with Cgc to arbfp1 and arbvp1

Cg is as easy to understand as C.

Of course there are more shaderlanguages. But i think these 3 mentioned are the best fitting for the project, because:
arb: standard for opengl
Cg: very much (commercial) documentation and tuts, which i can access for free, but i don't know how this works with ati cards, cause Cg comes from nVidia.
GLSLang: It's "pretty new", even better to read than Cg and comes directly from OpenGL.

I think the most popular language not mentioned is HLSL, which is for DirectX which is pöhse ;)

ox

edit: gl_arb_shader.c can load and link shaders, now there are some funcs needed to "use" the shaders in game (and probably to delete if not needed anymore for performance sake ;) ), but maybe they are implemented somewhere else.

Mattn:
no the functions to use the shaders are not in right now

Navigation

[0] Message Index

[#] Next page

Go to full version