Pages: 1 [2] 3
  Print  
Author Topic: ZEQ2  (Read 87775 times)
Hitchhiker
Member


Cakes 11
Posts: 181


« Reply #25 on: November 20, 2011, 11:12:51 AM »

Hi Peter,

in older builds these would be ignored. If glsl support added to OA they would be treated as a line that contains glsl program setup commands. with this in mind, anything after //. characters would, unless it is a valid glsl shader command, throw an error.
The escape sequence can be changed. Have you one in mind?

btw, I've not cleaned the code yet.. will do it this week. I have made changes to tr_bloom.c (as a test at this point - also needs to be cleaned and made to work in parallel with bloom and only if new cvars set - something like r_postprocessing "BWfilter" or r_postprocessing "none") to add sort of glsl postprocessing functionality. video here: http://www.youtube.com/watch?v=KxQbt7TCSWU

sorry about the delay...
Logged
Peter Silie
Member


Cakes 2008
Posts: 610



« Reply #26 on: November 20, 2011, 11:46:57 AM »

The ESC sequence sounds fine for me.
Dunno if neccessary, but maybe some kind of version information till the 1st space could be a good idea regarding future enhancements?
Example:
//.1 vertexProgram /glsl/code.glsl
//.345 vertexProgram /glsl/code.glsl

But i guess, thats overkill Wink
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #27 on: November 20, 2011, 11:02:35 PM »

maybe a //GLSL instead of //.? It's unlikely existing shaders with //GLSL from the 00's (LIKE EVER) will conflict.


By the way, Sago is having trouble merging the renderer to the engine, do you want to do it? I also have new changes as well (look for r_monolightmaps)
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 #28 on: November 21, 2011, 12:15:34 AM »

//GLSL sounds good. for future enhancements I cant think of other way than adding another (new) sequence.
I'm not sure what needs doing to get the code into the engine(I thought  it would just need pasting of source files)? Please let me know and I will give it a go..
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #29 on: November 21, 2011, 01:13:28 AM »

The just-uploaded 23 engine sources here


I'll probably merge my envmode/specmode/monolight/flares/bloom changes afterward
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 #30 on: November 23, 2011, 12:50:46 PM »

I can merge all together.. are your changes the ones in this post?http://openarena.ws/board/index.php?topic=4311.0
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #31 on: November 23, 2011, 04:16:18 PM »

That's an old version

These are where my changes are:
A full tree


Note that neither are the new 23 engine, it's still 22. Also i'm using your last GLSL release for these changes.

I can't make diffs right now.
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 #32 on: November 23, 2011, 05:48:46 PM »

Thanks fromhell!
I'll have a look. I'll use WinMerge to combine all the changes to the engine - should not be a problem.
btw, I've been adding depth buffer to postprocessing and it seems to work well on my configuration - to be tested on others. I've made a small glsl program that sort of detects edges and paints them black.. video: http://www.youtube.com/watch?v=g4lV5eNzJxs
Now is really time for me to put everything in place, create some documentation and upload the source.. Smiley will be back to you by the weekend..
Cheers!
Logged
Hitchhiker
Member


Cakes 11
Posts: 181


« Reply #33 on: November 27, 2011, 12:27:52 PM »

Hi,
here are the files (version 24) to add postprocessing. There is a clean 'glsl' folder included with two postprocessing programs as well as some documentation.
Hope this is OK?
Please let me know if you find any bugs with these additions and I will look into it..
Cheers

Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #34 on: November 28, 2011, 12:28:13 AM »

Postprocess shaders only show up when they're pk3'd. Can't use them outside pk3 files


also played with glsl...
« Last Edit: November 28, 2011, 01:04:21 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 #35 on: November 28, 2011, 02:40:57 PM »

I'm not sure how to access the shader unless they are in pack file - probably there is a function to call to load from the os filesystem? But this might be an issue, (I had a look at discussions regarding vertex lighting) as glsl programs that are outside the pack file could be made to include a sort of HDR filter that would make any shadow area of a map quite lightened.. not sure if I'm understanding the vertex light issue well? Anyway, I'll find a way to load from filesystem...i'm guessing should not take long. (btw, my OA specifies baseoa folder as search path but me placing glsl folder there was not found - I am on Windows and / and \ chars in file path might be the reason.. if you are on Linux, maybe worth a try?)
Regarding the screenshot.. is it one of glsl programs that I've sent that renders like this or was this a program you've made?

In meantime I started looking at glsl shadows.. trying to figure out how stencil shadows work (in theory and OA) in order to grab, at the right moment, scene's depth texture as rendered from the light's point.. If I'm understanding this well, this should be enough (with a small glsl program) to make realtime shadows..
Also, I saw your post about the light grid and deluxe bumpmapping.. maybe.. this possibly.. could already be done with glsl program but I haven't tried.. will try it and let you know ..
Logged
sago007
Posts a lot
*

Cakes 62
Posts: 1664


Open Arena Developer


WWW
« Reply #36 on: November 28, 2011, 03:55:41 PM »

I'm not sure how to access the shader unless they are in pack file - probably there is a function to call to load from the os filesystem?
Use "+set sv_pure 0" while developing and pack it in pk3 before distributing.
Logged

There are nothing offending in my posts.
Hitchhiker
Member


Cakes 11
Posts: 181


« Reply #37 on: November 29, 2011, 01:03:14 PM »

Cheers Sago007! didnt know that.. it does makes things easier.
in addition to sv_pure it would need this new tr_init.c that loads the postprocess program - the old one actually was testing to see if the requested program is inside the PAK file.. have commented that out..
« Last Edit: November 29, 2011, 01:28:39 PM by Hitchhiker » Logged
Hitchhiker
Member


Cakes 11
Posts: 181


« Reply #38 on: December 05, 2011, 02:36:45 PM »

I got the entities to draw with light info and with bumpmaps.. http://www.youtube.com/watch?v=bF6nBGx_v28
(note: the bump map used on the model is a random normal map image so it does not correspond to the model well).. so this all works for OA entities but I am now trying to find how to enable this for world brushes but so far no progress
all these terms like entity, brush, world,... are completely new to me Sad so I can't figure out where to look in the source to find why this would not work - if anyone can give a pointer as to should this be possible to do or which part of the source to look into (tr_backend, tr_world, .. Huh) would be appreciated.
 
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #39 on: December 05, 2011, 05:21:31 PM »

Remember that the game uses a lightgrid to specify lighting on models and such so be aware of that
before the lightgrid, Q and Q2 sampled from the bottom most brush lightmap pixel
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 #40 on: December 08, 2011, 01:14:56 PM »

Thanks fromhell!
i will try that but after looking at the source for few days I think it might take a bit of time..but even  this way I think that large triangles will not be correctly lit as some of smaller light sources will not be seen by the glsl program.
today i've made a water glsl program. not the one that does the reflections or refractions - for these maybe the engine could be tweaked to auto-generate a portal on the water surface and then send the rendered portal image to glsl (again, it might be a while before I can put this in place Sad )
i've made a video of how it looks.. http://www.youtube.com/watch?v=VkYgXeGeqwA (please dont mind the world geometry artifacts - i use them to understand what is illuminated when a dynamic light passes)

OA shader here looks like this:
textures/liquids/hydrowater
{

   surfaceparm nomarks
   surfaceparm trans
   surfaceparm water
   cull disable
   fogparms ( 0.215686 0.278431 0.333333 ) 1024
   {
      map textures/liquids/pool2.tga
      blendfunc filter
      tcMod scroll 0.05 0.05
   }
   {
      
      map textures/liquids/pool3d_4b2.tga
      blendfunc add
      rgbGen const ( 0.501961 0.501961 0.501961 )
      tcMod scroll -0.03 -0.06
      //GLSL map2 textures/stonewall2/normal.jpg
      //GLSL program water
      //GLSL vertexProgram glsl/water_vp.glsl
      //GLSL fragmentProgram glsl/water_fp.glsl
   }
   {
      map textures/liquids/pool3d_4b2.tga
      blendfunc add
      rgbGen const ( 0.501961 0.501961 0.501961 )
      tcGen environment
   }
   {
      map $lightmap
      blendfunc filter
      rgbGen identity
   }

}

eventually, to make the glsl water look better '//GLSL program skip' can be added to above non-glsl stages..
water glsl program here attached..
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #41 on: January 08, 2012, 02:23:17 AM »

hi

are you sitll working on a normalmapped model glsl shader? I wanna play with it for a bit early, see if I can get anywhere at normalmapping a character.

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 #42 on: January 08, 2012, 07:53:52 AM »

hi fromhell
i am actually trying to get the world entities lit.. the models can be made to use normal maps - all that is needed is the glsl program - I cannot recall sending the bump program? Embarrassed
Let me put together one that works well (have to get the lighting levels right which Im still trying to do).. I'm not sure where you are timezone wise.. so hopefully this version finds you in good time.

to apply the program to a model, add these lines to the shader:
    //GLSL map2 textures/stonewall2/normal2_stonewall.jpg  (your own normal map texture goes here)
    //GLSL program bump
    //GLSL vertexProgram glsl/bump_vp.glsl
    //GLSL fragmentProgram glsl/bump_fp.glsl
    //GLSL rgbGen lightingDynamic

Please let me know what you think about this program - what to improve?
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #43 on: January 08, 2012, 09:01:40 AM »

Doesn't work very well especially with mirrored UVs.

Try this modified angelyss/dark with a normal map I baked in Blender from a quick sculpt
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 #44 on: January 08, 2012, 03:31:56 PM »

thanks fromhell!
i will do this this week
Logged
Hitchhiker
Member


Cakes 11
Posts: 181


« Reply #45 on: January 09, 2012, 03:51:58 PM »

I'm experimenting... the skin looks almost OK - the effect is more visible in shadows.
the normal map is less visible on the clothes and armor due to the fact that the original texture already has this light detail incorporated. I will try to do some tests by making one texture from clothes/metal one using the hue values - see how that works. I've tried making the normal map more evident on the clothes/armor by making a second glsl program.
Here attached the two programs and the shader file if you wish to try.
 
Logged
Hitchhiker
Member


Cakes 11
Posts: 181


« Reply #46 on: January 29, 2012, 11:55:01 AM »

hi,
just an update..
I'm changing the way the light info is sent to the glsl programs so instead of having single light direction per entire entity I'm working on having per-vertex light info. The later should give better results.
I've made some progress but nothing complete. I do see a strange behavior when I'm playing or specting someone - the lighting is not done. If I am free flying around the world the lighting info is sent to the glsl program. So have to figure out what is different between the two modes (this is not glsl related but something in the engine makes it so).
I have no estimate yet as to when per-vertex lighting will work, please be patient - should not be longer than month or so.

If you would need me to do something in the meantime, please let me know.

Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #47 on: February 20, 2012, 01:14:26 PM »

Hi! I just created a section about GLSL here:
(DO NOT LINK) h t t p s : / / openarena . wikia . com/wiki/Manual/Graphic_options#GLSL_effects

It's just an overview about GLSL (please check and fix it where needed), anyway it would be better if you could create a proper "GLSL" article where explaining eveything in a deeper way, with istructions about how to create glsl programs and how to use them.
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
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #48 on: February 20, 2012, 06:27:43 PM »

I noticed fullscreening a window with glsl on sends it erroring to menu in a unrecoverable  loop

I tried to implement SSAO to failure...
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 #49 on: February 22, 2012, 02:46:54 PM »

Sad
which glsl programs used? I've just tried with postprocessing one and could not get it to fail like that.. I was switching between windowed and fullscreen mode by pressing ALT+ENTER (Windows OS) and also using GUI.

if this was with ssao program (or other) that has an error, could you send me the program to test on my end?


as for per vertex lighting.. I've managed to get 32 glsl lights to work per-pixel.. so this should be quite easy to downgrade to per-vertex lighting.. but, after it all, my problem at the moment is the same as before - cant get the ambient light per world model to glsl program..  so will have to find a way to get that in place and will post the changes.

Logged
Pages: 1 [2] 3
  Print  
 
Jump to: