Hitchhiker
Member
Cakes 11
Posts: 181
|
|
« on: October 22, 2011, 10:28:58 AM » |
|
Hi, seems there is a game using ioQuake3 engine with GLSL support -> http://www.youtube.com/watch?v=0W7YjdrbyqE it seems the cell shaders work well and if the entire implemetation of GLSL is not buggy, there is no reason for other glsl shaders not to work. More info here -> http://zeq2.com/lite/forums/viewtopic.php?t=1284&highlight=glslI have started doing something similar (having one stage of a shader be GLSL program) with OA but am not exactly close to a working version. kind regards, Hitchhiker
|
|
|
Logged
|
|
|
|
Gig
In the year 3000
Cakes 45
Posts: 4394
|
|
« Reply #1 on: October 22, 2011, 11:20:16 AM » |
|
|
|
|
Logged
|
I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
|
|
|
Hitchhiker
Member
Cakes 11
Posts: 181
|
|
« Reply #2 on: October 22, 2011, 12:08:39 PM » |
|
Hi Gig, u mean just copy the SDL and renderer files to OA code dir and compile? could that work? Hitch
|
|
|
Logged
|
|
|
|
Gig
In the year 3000
Cakes 45
Posts: 4394
|
|
« Reply #3 on: October 22, 2011, 12:35:00 PM » |
|
I was not saying anything about how to resolve GLSL problems (I don't even know what GLSL is!)... I was simply saying that this ZEQ game is not the first DragonBall Z game based upon id Tech 3. Years ago, a Q3 mod called Bid for Power (well, there were also others, I have a map from "DBQ", but I never played the DBQ mod itself, I simply found that CellGameDBQ map somewhere), was a similar concept, before they were forced to remove all references to dragonball characters and locations cause of copyright/trademark reasons!
|
|
|
Logged
|
I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
|
|
|
fromhell
|
|
« Reply #4 on: October 22, 2011, 02:04:54 PM » |
|
I think the focus of this thread is all about the GLSLage, which I wouldn't mind in OA at all as long as it doesn't deprecate/regress the current GL 1.1 rendering path.
Granted, I liked and followed BFP's development back in the day and its legal rollercoaster (2000), I still think that's the best DBZ mod overall today, because Rodney is an awesome skinner.
The illicit forks suck though and are a product of serious legal ignorance facepalm (eBFP (Final))
OA uses some Zeq2 code already BTW. The fixed specular position code is in the renderer (r_specmode 1) and it makes the models look oh so much better. It just needs proper worldspace tcGen environment now, I swear I got one coordinate mixed... want it to match the raven implementation
|
|
|
Logged
|
asking when OA3 will be done won't get OA3 done. Progress of OA3 currently occurs behind closed doors alone I do not provide technical support either.new code development on github
|
|
|
Hitchhiker
Member
Cakes 11
Posts: 181
|
|
« Reply #5 on: October 22, 2011, 02:48:03 PM » |
|
Hi Fromhell, thanks for making clear what the thread was about - my bad Gig, I missed some words in original post. I think if OpenGL Shading Language support in ZEQ2 is stable, it would be easily included in OA. But how would that work - meaning who would be doing this? Does it need to go through the ioQuake project? Otherwise if you agree, I can try the inclusion to OA.. hitchhiker
|
|
|
Logged
|
|
|
|
fromhell
|
|
« Reply #6 on: October 22, 2011, 02:51:50 PM » |
|
A lot of things in OA doesn't go through the ioq3 project. There's lots of rendering changes already, ioq3 would probably hate to have them.
Glad ZEQ2 reached stability on it though, because I wouldn't take a step ANYWHERE near the oft-suggested XreaL.
|
|
|
Logged
|
asking when OA3 will be done won't get OA3 done. Progress of OA3 currently occurs behind closed doors alone I do not provide technical support either.new code development on github
|
|
|
Hitchhiker
Member
Cakes 11
Posts: 181
|
|
« Reply #7 on: October 29, 2011, 07:32:52 AM » |
|
hi, just wanted to update the post with progress made, for what is worth. i managed to move the functionality from ZEQ2 to OA. glsl programs compile and (for little i was able to test) do work. the glsl support in ZEQ2 does not implement few things that I think ioQuake3 project would consider enough not to include this code in ioQuake3.
as for how my OA now looks... i do get texturing artifacts on almost all maps - as far as i can see, these are due to multiple textures used in a single shader/stage which are then drawn using glsl default shader. i am trying to figure out why it happens.
im trying to do this in the evenings or weekend so cant tell you how long could it take to have a working version. Im hoping less than two weeks.
|
|
|
Logged
|
|
|
|
Cacatoes
Banned for leasing own account
Posts a lot
Cakes 73
Posts: 1427
also banned for baiting another to violate rules
|
|
« Reply #8 on: October 29, 2011, 07:52:12 AM » |
|
This seems great Hitch, would it be easy to make a patch from it ? If it could both apply to ioq3's SVN and our OA that'd be sweet. Maybe some screenshots of current progress ?
|
|
|
Logged
|
Todo: Walk the cat.
|
|
|
Hitchhiker
Member
Cakes 11
Posts: 181
|
|
« Reply #9 on: November 11, 2011, 04:26:59 PM » |
|
Hi, I'm uploading videos now. The glsl support is ready for some testing. I can send the modified files to someone to commit to SVN but am not sure who? Basically the renderer works exactly the same as it would without the glsl support (multiple passes for multiple stages within the shader) and only uses defined glsl program for a single stage of a shader. So your shader could have multiple stages which render normally when glsl support is switched off (glsl commands in the shader are 'ignored' if there is no glsl support or glsl rendering pipeline is disabled by a cvar) and the same shader would have its glsl stage rendered by a glsl program if the glsl was ON. In the below video the floor shader looks like this: //=========== 117 ========= textures/base_floor/clangdark { surfaceparm metalsteps { map textures/stonewall2/diffuse_stonewall.jpg map2 textures/stonewall2/bump2_stonewall.jpg map3 textures/stonewall2/normal2_stonewall.jpg program paralax vertexProgram /glsl/paralax_vp.glsl fragmentProgram /glsl/paralax_fp.glsl } { map $lightmap rgbgen identity blendFunc GL_DST_COLOR GL_ZERO } } So at the end, this could work in a transparent way for any game using ioQuake3. It will not speed up rendering - not the way it is setup now, but it does add functionality to the renderer. I will put together a kind of tutorial on how everything is setup now (i.e. z-gpl-q3a2oa-textures-v5.pk3 now has a new folder called glsl that holds the vertex and fragment programs). Also which are the new shader stage commands (I only tested few) and how to add a program to a stage (can be seen above). I havent tried yet using the shader commands that modify the vertex positions or texture coordinates - to be tested to see if the vertex data and coordinates are passed correctly to the glsl program - they will work normally if no glsl is used. Is probably a bad idea, but if someone wants Windows binaries of OA with glsl support, let me know and i can upload it somewhere. I say 'bad idea' because if something goes wrong .... so standard 'there is this file there.. dont know what it is, does or what to do with it..' disclaimer will apply. anyway, probably better option I just send the modified source files in a zip to you guys? The rendering, how it is setup now can be speeded up very slightly. Should I maybe look into that before sending you the code? I've managed to upload a video to yt.. (yay!) http://www.youtube.com/user/OAHitchhikerbut the quality suffered .... seeing this is my third attempt to get the video up, ill leave it at this for the moment.. also, with some lights the parallax mapping would be more obvious. (the errors that appear at the beginning of the video - just saw them.. need to check the shader for Sorceress - it started as cel shader but i was unable to get it to work so it turned to simple 8-bits-per-color-channel-downgradeto-2-bits per channel kinda useless program) - again, toon shaders seem to need a light source as well.. havent figured out those yet OK, this update is a quick off-the-top-of-my-head so missing details, but in general, glsl support is in place - needs testing. Hope you can see the effects in the video.. here also a screenshot.. Let me know what you think?
|
|
|
Logged
|
|
|
|
fromhell
|
|
« Reply #10 on: November 11, 2011, 04:35:44 PM » |
|
You could attach the code here. I don't see any harm in that Can't wait to play with glsl! what i'd most likely do is cubemap reflection shaders on the water and metal surfaces so I can at least catch up to 2004, and maybe phong-shaded models, or perhaps a more important shader: sRGB color control By the way i've done an anime-style shading shader for Darkplaces before, but it relies on a modern deferred rendering and lighting approach to effectively work.
|
|
« Last Edit: November 11, 2011, 05:02:13 PM by fromhell »
|
Logged
|
asking when OA3 will be done won't get OA3 done. Progress of OA3 currently occurs behind closed doors alone I do not provide technical support either.new code development on github
|
|
|
Hitchhiker
Member
Cakes 11
Posts: 181
|
|
« Reply #11 on: November 12, 2011, 02:17:52 PM » |
|
The source files here attached. the 'glsl' folder would need to go to root of z-gpl-q3a2oa-textures-v5.pk3 (or other place you feel is more appropriate). Maybe something for another thread, but to do any lightning a good thing would be to have OA .bps files of a map be accompanied by a .light file that would contain all the 'light' objects from the respective .map file. then dynamic lights (explosions, etc) would be mixed with that and rendered. I was trying to find what a sRGB color control would be - have found only some postprocessing articles - is this what you mean by sRGB cc? Hope the source files compile... i've tried not to change anything but what was needed but maybe i've crashed some function trying to make it compile for me.. :\ p.s. if you wish to start making glsl programs, on ZEQ2 site forum there is a list of possible commands and variables ( http://zeq2.com/lite/forums/viewtopic.php?t=1284&highlight=glsl) - rgbGen lightingUniform, rgbGen lightingDynamic & tcgen cel will not work in this version (i was fighting to resolve some problems with rendering and have copied only the bare minimum.. now the problem resolved, i will add these and some optimization in the next week-two)
|
|
« Last Edit: November 12, 2011, 02:55:50 PM by Hitchhiker »
|
Logged
|
|
|
|
fromhell
|
|
« Reply #12 on: November 14, 2011, 03:19:36 AM » |
|
Yeah I'm having trouble trying to integrate this into the source here. For some reason it's throwing errors about BoxOnPlaneSide and g_color_table. BTW OA won't come with those cel and parallax shaders.
|
|
|
Logged
|
asking when OA3 will be done won't get OA3 done. Progress of OA3 currently occurs behind closed doors alone I do not provide technical support either.new code development on github
|
|
|
Hitchhiker
Member
Cakes 11
Posts: 181
|
|
« Reply #13 on: November 14, 2011, 02:38:36 PM » |
|
I'll have a look. BoxOnPlaneSide might have been tweeked so it would compile for me.. Is not part of glsl support so can be replaced/removed to correspond to original OA source.. the parallax and cel shader that are in glsl folder i've sent are just an example.. im not even sure the cell one works..
|
|
|
Logged
|
|
|
|
Hitchhiker
Member
Cakes 11
Posts: 181
|
|
« Reply #14 on: November 14, 2011, 03:00:55 PM » |
|
ok.. the source you've sent the link of is not the one i was using.. I downloaded mine from the page on the wiki.. ( DO NOT LINK) h t t p s : / / openarena . wikia . com/wiki/DeveloperFAQ ... now i see its not the openarena.ws site at all I'll move the changes from mine to the newer one asap... sorry bout taking your time and the trouble ;(
|
|
« Last Edit: November 14, 2011, 03:16:53 PM by Hitchhiker »
|
Logged
|
|
|
|
Cacatoes
Banned for leasing own account
Posts a lot
Cakes 73
Posts: 1427
also banned for baiting another to violate rules
|
|
« Reply #15 on: November 14, 2011, 03:31:46 PM » |
|
Don't worry Hitch, access to OA code has never been very intuitive, hope it doesn't make you work much more than what you had to. Wikia.com is the official OpenArena wiki, but there are things which aren't very tidy.
|
|
|
Logged
|
Todo: Walk the cat.
|
|
|
Gig
In the year 3000
Cakes 45
Posts: 4394
|
|
« Reply #16 on: November 14, 2011, 04:25:07 PM » |
|
Hi Hitchhiker. Every help to expand and fix the wiki is appreciated (a list of things that could be improved there is DO NOT LINK[/b]) h t t p s : / / openarena . wikia . com/wiki/WikiWorks]here).
|
|
|
Logged
|
I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
|
|
|
Hitchhiker
Member
Cakes 11
Posts: 181
|
|
« Reply #17 on: November 14, 2011, 04:42:08 PM » |
|
Hi Cacatoes! No worries! I think it took about the same time Hi Gig! I'll have a look.. the updated files are here attached.. I pasted them to my clean source folder (one created from the link fromhell has kindly provided) and the make went on to create the excutable file. If it does not work now i dont know what to do..
|
|
|
Logged
|
|
|
|
fromhell
|
|
« Reply #18 on: November 14, 2011, 11:17:03 PM » |
|
For some reason, it renders nothing - only the cinematics. r_ext_vertex_shader 0 renders nothing. Otherwise, it does. Warnings I get: CC code/renderer/tr_shade.c code/renderer/tr_shade.c:1187:1: warning: return type defaults to 'int' code/renderer/tr_shade.c:1346:1: warning: return type defaults to 'int' code/renderer/tr_shade.c:1346:1: warning: function declaration isn't a prototype
code/renderer/tr_shade.c: In function 'RB_IterateStagesGeneric': code/renderer/tr_shade.c:1402:17: warning: unused variable 'program' code/renderer/tr_shade.c: In function 'GLSL_Clean': code/renderer/tr_shade.c:1395:1: warning: control reaches end of non-void functi on code/renderer/tr_shade.c: In function 'GLSL_Feeder': code/renderer/tr_shade.c:1343:1: warning: control reaches end of non-void functi on CC code/renderer/tr_shade_calc.c CC code/renderer/tr_shader.c code/renderer/tr_shader.c:72:23: warning: 'R_GLSL_GetProgramByHandle' defined bu t not used CC code/renderer/tr_shadows.c CC code/renderer/tr_sky.c I think the non-GLSL fallback isn't working. Also some shader ideas: - Reflective water, hydronex is a good test area for such thing - Phong shading (Makehuman has a phong glsl program) - An all-new bloom shader - Censor shader (for implying more explicit gibbery)
|
|
« Last Edit: November 15, 2011, 01:36:17 AM by fromhell »
|
Logged
|
asking when OA3 will be done won't get OA3 done. Progress of OA3 currently occurs behind closed doors alone I do not provide technical support either.new code development on github
|
|
|
Hitchhiker
Member
Cakes 11
Posts: 181
|
|
« Reply #19 on: November 15, 2011, 02:23:03 PM » |
|
Hi, i got the check in order. now it renders correctly. new files here attached. I'll clean the code a bit so no warnings are displayed. I also just noticed that I cannot switch to vertex lit rendering so this is something to look into.. also i tried original excutable of OA with the map I modified by adding a glsl program and it didnt work very nicely.. so you can try the glsl programming a bit.. it's back to the drawing board for me. will keep you posted on progress.
|
|
|
Logged
|
|
|
|
fromhell
|
|
« Reply #20 on: November 15, 2011, 02:44:55 PM » |
|
I also just noticed that I cannot switch to vertex lit rendering so this is something to look into..
This is intentional
|
|
|
Logged
|
asking when OA3 will be done won't get OA3 done. Progress of OA3 currently occurs behind closed doors alone I do not provide technical support either.new code development on github
|
|
|
Hitchhiker
Member
Cakes 11
Posts: 181
|
|
« Reply #21 on: November 15, 2011, 04:57:34 PM » |
|
Oh.. thanks for the info fromhell I've went on to modify the COM_Parser so it could detect a new keyword which will stop the new shader files from breaking the older builds of the game. The quickest solution I've found is to prefix each glsl related keyword with "//." characters so for older builds this will only be a comment and ignored while builds aware of this escape characters will skip the 3 char sequence and tokenize the reminder of the line. Unless anyone can suggest a better way, now glsl related keywords should be written something like this: //=========== 117 ========= textures/base_floor/clangdark { surfaceparm metalsteps { map textures/stonewall2/diffuse_stonewall.jpg //.map2 textures/stonewall2/bump2_stonewall.jpg //.map3 textures/stonewall2/normal2_stonewall.jpg //.program paralax //.vertexProgram /glsl/paralax_vp.glsl //.fragmentProgram /glsl/paralax_fp.glsl } { map $lightmap rgbgen identity blendFunc GL_DST_COLOR GL_ZERO } } I've cleaned the warnings that were present. will take few days to double check everything before coming back with yet another zip file.. as for the shaders you mention fromhell, I will try to see which could be done but as i never did any of the glsl programming can't promise much. Let's see how that goes cheers
|
|
|
Logged
|
|
|
|
fromhell
|
|
« Reply #22 on: November 15, 2011, 11:47:16 PM » |
|
It works! (The vertex shader 0 fallback) thanks, could be 088'd BTW, you could prototype the glsl shaders in polydraw
|
|
« Last Edit: November 16, 2011, 01:41:23 AM by fromhell »
|
Logged
|
asking when OA3 will be done won't get OA3 done. Progress of OA3 currently occurs behind closed doors alone I do not provide technical support either.new code development on github
|
|
|
Hitchhiker
Member
Cakes 11
Posts: 181
|
|
« Reply #23 on: November 16, 2011, 03:39:04 PM » |
|
glad to hear it.. if all tests go ok, yes, would be nice if it could be included in the new version. thanks for the link to Ken Silverman's projects - there is more than polydraw that i like on his page. I think I can send you the cleaned zip file this weekend. i had a quick look at reflections and refractions and they need the scene re-rendered and stored to opengl texture to work. I'll have a look at bloom effect and how it stores the scene - maybe could be reused atleast for reflections or give some pointers how to prepare the textures for water shader. Thanks again and sorry about the incomplete source code earlier!
|
|
|
Logged
|
|
|
|
Peter Silie
Member
Cakes 2008
Posts: 610
|
|
« Reply #24 on: November 16, 2011, 04:25:02 PM » |
|
I didn´t followed the thread because my knowledge about glsl programs aren´t that great, but it leads me to a question: is this a safe solution?
what happens to this lines: 1. example for existing shaders //... (this is a valid comment)
2. example for development //.vertexProgram /glsl/buggy_code.glsl
3. example for typo //.evilProgram /glsl/dummy.glsl
4. example for 1337 h4x3r5 //.vertexProgram /glsl/do_something_evil_if_possible.glsl
|
|
|
Logged
|
|
|
|
|