Pages: 1 ... 5 6 [7] 8
  Print  
Author Topic: GLSL  (Read 103092 times)
grey matter
Member


Cakes 8
Posts: 381

>9k


« Reply #150 on: April 06, 2014, 04:03:44 pm »

You need to push your changes to GitHub or any other origin that you've set up.
Logged

This space is for rent.
Hitchhiker
Member


Cakes 11
Posts: 180


« Reply #151 on: April 07, 2014, 11:47:51 am »

Thanks grey matter
I'm trying to make it work.
« Last Edit: April 07, 2014, 01:11:27 pm by Hitchhiker » Logged
Hitchhiker
Member


Cakes 11
Posts: 180


« Reply #152 on: April 10, 2014, 02:24:11 pm »

no luck for me and the github.
If it's OK with you, I'll be posting here the modified files together with a test map and new glsl programs in it.
Logged
Neon_Knight
In the year 3000
***

Cakes 49
Posts: 3653


Trickster God.


« Reply #153 on: April 10, 2014, 04:02:24 pm »

Try contacting hairball or sago007.
Logged


"Level Designers are 1 part architect, 1 part artist, 1 part game designer, and 1 part beta tester!" Cliff Bleszinski
Want to contribute? Read this.
fromhell
Administrator
GET A LIFE!
**********

Cakes 31
Posts: 14471



WWW
« Reply #154 on: April 10, 2014, 05:59:22 pm »

You could probably do a fork and maybe I can pull it somehow.


I did bunch of changes lately to accomodate some unacceptable things in secret progress.
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: 180


« Reply #155 on: April 11, 2014, 12:02:13 pm »

Forking the engine I can upload the changes. I think I've uploaded all of the changed files. Will need to sit down and re-check everything and clean a little but this should work as is. As for the glsl programs.. seems its never done by the deadline I give myself so I hope this weekend I can send those as well..
for the engine part I need to add:
-postprocessing uniform u_SunPos (for godrays).. I have like 10 versions of OA source on my 4 hard disks so will be easier to re-write it than find Smiley
-postprocessing uniform u_ViewDir_Old - for motion blur effect

for the glsl programs I still need to rewrite most of them to use the normals. and do a new set of postprocessing programs because the older ones will not work in this new system. So probably need to create a new cvar - r_postprocess_multi that will load multiple post fx(s) into a single program and restore the original single postprocess program loading part.. run them in parallel.. older one taking precedence? Anyway, we can decide on this once in place..


« Last Edit: April 11, 2014, 12:51:45 pm by Hitchhiker » Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 31
Posts: 14471



WWW
« Reply #156 on: May 18, 2014, 08:15:35 pm »

I've committed an attempt at making 'fallbackShader' out of my postprocess shaders as well as the shaders themselves in renderer_oa similar to how renderergl2 does it, but I can't seem to get them included even when extern'd and put through the makefile.  Any idea what's wrong?

tr_init.c is where i'm trying to do it.


i'm trying to integrate my shaders directly into the dll/so if it doesn't find an external to load.  Which is very necessary concerning GLSL brightness....

« Last Edit: May 18, 2014, 10:05:17 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: 180


« Reply #157 on: May 21, 2014, 12:35:52 pm »

maybe you can paste your glsl shaders code directly in the tr_init.c? Sort of a string constant (?) and pass that to the compile/register function?

i.e.
const GLchar* vert =
"#version 120\n"
"attribute vec2 position;"
"void main()"
"{"
"    gl_Position = vec4( position, 0.0, 1.0 );"
"}"
;

If I understand correctly, you are trying to do this in case the pk3 file does not contain the correct glsl program?
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 31
Posts: 14471



WWW
« Reply #158 on: May 21, 2014, 01:43:41 pm »

Correct, and make it built-into the dll while allowing the glsl shaders themselves to be maintainable via Github.   I would work on the main shaders in the baseoa/glsl folder as working copies to put in the DLL for later.  Note this does not apply to map shaders like stream etc, but rather the 'important' shaders that have no reason being stuck in pak files.

Also O/T:, I did get _cel working.  I had to use va("%s_cel", name) instead in R_FindShader, and renamed the original function with a wrapper function to make it look for an available cel texture for r_anime.  
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
SharpestTool
Lesser Nub


Cakes -27
Posts: 143


« Reply #159 on: July 07, 2014, 02:30:17 am »

To make it built into the DLL...you have to build a script to "stringify" them as c files.
I know not everyone here is a fan of MS Tools but there is a script in the MSVC directory...StringifyGLSL.vbs
It turns everything into a c file.  You add that as your externs.   Works like a charm to build under MSVC.   

BTW...tried building the engine.   Ran fine until I got to the new GLSL Shaders:  On an 8800GTS here's what it does.

Here's the dump of my config:
seta r_motionblur "1"
seta r_tvModeAspect "0"
seta r_tvMode "1"
seta r_anime "1"
seta r_retroAA "1"
seta r_leifx "1"
seta r_leiwater "1"
seta r_flaresDlight "1"
seta r_flareMethod "1"
seta r_flareQuality "1"
seta r_shadeMode "1"
seta r_ext_vertex_shader "1"

Here are the relevant lines from the crash dump:
Error:
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(52) : warning C7011: implicit cast from "int" to "float"
0(56) : warning C7549: OpenGL does not allow C style initializers
0(56) : warning C7553: OpenGL array assignments require #version 120
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(59) : warning C7011: implicit cast from "int" to "float"
0(63) : warning C7549: OpenGL does not allow C style initializers
0(63) : warning C7553: OpenGL array assignments require #version 120
0(70) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(70) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(70) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(71) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(71) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(71) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(72) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(72) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(72) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(73) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(73) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(73) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(74) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(74) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(74) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(75) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(75) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(75) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(76) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(76) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(76) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(77) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(77) : warning C7502: OpenGL does not allow type suffix 'f' on constant literals
0(77) : warning C7502: OpenGL does not allow^3Couldn't compile fragment shader for program anime^3WARNING: uniform float u_ScreenSizeX; unrecognized in program anime_film
^3WARNING: uniform float u_ScreenSizeY; unrecognized in program anime_film
^3WARNING: uniform float u_ScreenSizeX; unrecognized in program anime_film
^3WARNING: uniform float u_ScreenSizeY; unrecognized in program anime_film
^3WARNING: uniform float u_ScreenSizeX; unrecognized in program leifx_dither
^3WARNING: uniform float u_ScreenSizeY; unrecognized in program leifx_dither
^3WARNING: uniform float u_ScreenSizeX; unrecognized in program leifx_dither
^3WARNING: uniform float u_ScreenSizeY; unrecognized in program leifx_dither
^3WARNING: uniform float u_ScreenSizeX; unrecognized in program leifx_filter
^3WARNING: uniform float u_ScreenSizeY; unrecognized in program leifx_filter
^3WARNING: uniform float u_ScreenSizeX; unrecognized in program leifx_filter
^3WARNING: uniform float u_ScreenSizeY; unrecognized in program leifx_filter
^3WARNING: uniform float u_ScreenSizeX; unrecognized in program motionblur_accum
^3WARNING: uniform float u_ScreenSizeY; unrecognized in program motionblur_accum
^3WARNING: uniform sampler2D u_mpass1; unrecognized in program motionblur_accum
^3WARNING: uniform sampler2D u_mpass2; unrecognized in program motionblur_accum
^3WARNING: uniform sampler2D u_mpass3; unrecognized in program motionblur_accum
^3WARNING: uniform sampler2D u_mpass4; unrecognized in program motionblur_accum
^3WARNING: uniform float u_ScreenSizeX; unrecognized in program motionblur_accum
^3WARNING: uniform float u_ScreenSizeY; unrecognized in program motionblur_accum
Error:
0(21) : warning C7011: implicit cast from "int" to "float"
0(21) : warning C7549: OpenGL does not allow C style initializers
0(21) : warning C7553: OpenGL array assignments require #version 120
0(33) : error C1115: unable to find compatible overloaded function "texture2D(error, vec2)"
0(34) : error C1115: unable to find compatible overloaded function "texture2D(error, vec2)"
0(35) : error C1115: unable to find compatible overloaded function "texture2D(error, vec2)"
0(36) : error C1115: unable to find compatible overloaded function "texture2D(error, vec2)"
0(37) : warning C7011: implicit cast from "int" to "float"

^3Couldn't compile fragment shader for program motionblur_post^3Couldn't load glsl/crt_vp.glslInitializing Shaders

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

Cakes 31
Posts: 14471



WWW
« Reply #160 on: July 23, 2014, 03:44:27 am »

A lot of those ScreenSixeX/Y's are ints being cast as floats by accident. Easily fixable


also i've tried to port cgwg and themaister's NTSC effect to OA for fun and learning, can't seem to decode the picture to a color signal however...  Replace leifx_dither/gamma with these if you want to quickly test this on the latest git engine, set r_leifx 3 after


leifx_dither.glsl/ntsc_encode.glsl
Code:
//    NTSC encoding artifact shader
//
//    This shader renders the input image with added NTSC artifacts, by
//    transforming the input into an NTSC signal, then decoding it again.
//    It was originally developed in this forum thread:
//
// http://board.byuu.org/viewtopic.php?f=10&t=1494
//
//    Copyright (C) 2010-2012 cgwg and Themaister
//
//    This program is free software; you can redistribute it and/or modify it
//    under the terms of the GNU General Public License as published by the Free
//    Software Foundation; either version 2 of the License, or (at your option)
//    any later version.
//

// Buggy porting by fromhell

uniform sampler2D u_Texture0;
varying vec2 texture_coordinate;
uniform float u_ScreenToNextPixelX;
uniform float u_ScreenToNextPixelY;
uniform int u_ScreenSizeX;
uniform int u_ScreenSizeY;
uniform float u_Time;

vec2 rubyTextureSize;
vec2 rubyInputSize;


#define TEX2D(c) texture2D(u_Texture0,(c))


#define PI 3.14159265

#define size_x 720

void main()
{
rubyTextureSize.x = 1 / u_ScreenToNextPixelX;
rubyTextureSize.y = 1 / u_ScreenToNextPixelY;
// rubyTextureSize.x = 720;
// rubyTextureSize.y = 480;
// rubyInputSize.x = 1 / u_ScreenToNextPixelX;
// rubyInputSize.y = 1 / u_ScreenToNextPixelY;
// rubyInputSize.x = 1 / u_ScreenToNextPixelX;
// rubyInputSize.y = 1 / u_ScreenToNextPixelY;

rubyInputSize.x = u_ScreenSizeX;
rubyInputSize.y = u_ScreenSizeY;


float rubyFrameCount = u_Time;

        vec2 xy =  texture_coordinate.st;

        vec2 xyp = xy * rubyTextureSize * 4.0 * PI / 3.0;
        xyp.y = xyp.y / 2.0 + 2.0 * PI / 3.0 * mod(rubyFrameCount,2);

        vec4 rgb = TEX2D(xy);

        mat3x3 rgb2yuv = mat3x3(0.299,-0.14713, 0.615,
                 0.587,-0.28886,-0.51499,
                 0.114, 0.436  ,-0.10001);

        vec3 yuv;
        yuv = rgb2yuv * rgb.rgb;

        float dx = PI/3.0;
        xyp.x = xyp.x * rubyInputSize.x/256.0;
        float c0 = yuv.x + yuv.y * sin(xyp.x+xyp.y) + yuv.z*cos(xyp.x+xyp.y);
        float c1 = yuv.x + yuv.y * sin(xyp.x+xyp.y+dx) + yuv.z * cos(xyp.x+xyp.y+dx);
        rgb = TEX2D(xy + vec2(1.0/rubyTextureSize.x * rubyInputSize.x / 512.0, 0.0));
        yuv = rgb2yuv * rgb.rgb;
        float c2 = yuv.x + yuv.y * sin(xyp.x+xyp.y+2.0*dx) + yuv.z * cos(xyp.x+xyp.y+2.0*dx);
        float c3 = yuv.x + yuv.y * sin(xyp.x+xyp.y+3.0*dx) + yuv.z * cos(xyp.x+xyp.y+3.0*dx);

        gl_FragColor = (vec4(c0,c1,c2,c3)+0.65)/2.3;
}

leifx_gamma.glsl/ntsc_decode.glsl
Code:
//    NTSC encoding artifact shader
//
//    This shader renders the input image with added NTSC artifacts, by
//    transforming the input into an NTSC signal, then decoding it again.
//    It was originally developed in this forum thread:
//
// http://board.byuu.org/viewtopic.php?f=10&t=1494
//
//    Copyright (C) 2010-2012 cgwg and Themaister
//
//    This program is free software; you can redistribute it and/or modify it
//    under the terms of the GNU General Public License as published by the Free
//    Software Foundation; either version 2 of the License, or (at your option)
//    any later version.
//


uniform sampler2D u_Texture0;
varying vec2 texture_coordinate;
uniform float u_ScreenToNextPixelX;
uniform float u_ScreenToNextPixelY;
uniform int u_ScreenSizeX;
uniform int u_ScreenSizeY;
uniform int u_ActualScreenSizeX;
uniform int u_ActualScreenSizeY;
uniform float u_Time;
vec2 rubyTextureSize;
vec2 rubyInputSize;
//uniform vec2          rubyTextureSize;
//uniform vec2          rubyInputSize;

#define TEX2D(c) texture2D(u_Texture0,(c))

#define PI 3.14159265

#define size_x 1024
#define scale_y 4

void main()
      {
//rubyTextureSize.x = ize_x / u_ScreenToNextPixelX;
// rubyTextureSize.x = 720;
// rubyTextureSize.y = 480;
rubyTextureSize.x = 720;
rubyTextureSize.y = u_ScreenSizeY;

//rubyTextureSize.x = 720;
// rubyTextureSize.y = 480;

rubyInputSize.x = 2880;
rubyInputSize.y = u_ScreenSizeY;

// rubyInputSize.x = 629;
// rubyInputSize.y = 480;
float rubyFrameCount = u_Time;
        vec2 xy =  texture_coordinate.st;
       // vec2 xy = gl_TexCoord[0].st;

          vec2 xyf = fract(xy * rubyTextureSize);
        vec2 xyp = floor(xy * rubyTextureSize)+vec2(0.5);
        xy = xyp / rubyTextureSize;
        float offs = mod(rubyFrameCount,2)/2.0;
        vec4 phases = (vec4(0.0,0.25,0.5,0.75) + vec4(xyp.x+xyp.y/2.0+offs)) *4.0*PI/3.0;
        vec4 phasesl = (vec4(0.0,0.25,0.5,0.75) + vec4(-1.0+xyp.x+xyp.y/2.0+offs)) *4.0*PI/3.0;
        vec4 phasesr = (vec4(0.0,0.25,0.5,0.75) + vec4( 1.0+xyp.x+xyp.y/2.0+offs)) *4.0*PI/3.0;
        vec4 phsin = sin(phases);
        vec4 phcos = cos(phases);
        vec4 phsinl= sin(phasesl);
        vec4 phcosl= cos(phasesl);
        vec4 phsinr= sin(phasesr);
        vec4 phcosr= cos(phasesr);
        vec4 phone = vec4(1.0);

        vec2 one = 1.0/rubyTextureSize;

        vec4 c = TEX2D(xy)*2.3-0.65;
        vec4 cl= TEX2D(xy + vec2(-one.x,0.0))*2.3-0.65;
        vec4 cr= TEX2D(xy + vec2( one.x,0.0))*2.3-0.65;

        vec3 yuva = vec3((dot(cl.zw,phone.zw)+dot(c.xyz,phone.xyz)+0.5*(cl.y+c.w))/6.0, (dot(cl.zw,phsinl.zw)+dot(c.xyz,phsin.xyz)+0.5*(cl.y*phsinl.y+c.w*phsin.w))/3.0, (dot(cl.zw,phcosl.zw)+dot(c.xyz,phcos.xyz)+0.5*(cl.y*phcosl.y+c.w*phcos.w))/3.0);

        vec3 yuvb = vec3((cl.w*phone.w+dot(c.xyzw,phone.xyzw)+0.5*(cl.z+cr.x))/6.0, (cl.w*phsinl.w+dot(c.xyzw,phsin.xyzw)+0.5*(cl.z*phsinl.z+cr.x*phsinr.x))/3.0, (cl.w*phcosl.w+dot(c.xyzw,phcos.xyzw)+0.5*(cl.z*phcosl.z+cr.x*phcosr.x))/3.0);

        vec3 yuvc = vec3((cr.x*phone.x+dot(c.xyzw,phone.xyzw)+0.5*(cl.w+cr.y))/6.0, (cr.x*phsinr.x+dot(c.xyzw,phsin.xyzw)+0.5*(cl.w*phsinl.w+cr.y*phsinr.y))/3.0, (cr.x*phcosr.x+dot(c.xyzw,phcos.xyzw)+0.5*(cl.w*phcosl.w+cr.y*phcosr.y))/3.0);

        vec3 yuvd = vec3((dot(cr.xy,phone.xy)+dot(c.yzw,phone.yzw)+0.5*(c.x+cr.z))/6.0, (dot(cr.xy,phsinr.xy)+dot(c.yzw,phsin.yzw)+0.5*(c.x*phsin.x+cr.z*phsinr.z))/3.0, (dot(cr.xy,phcosr.xy)+dot(c.yzw,phcos.yzw)+0.5*(c.x*phcos.x+cr.z*phcosr.z))/3.0);

        mat3x3 yuv2rgb = mat3x3(1.0, 1.0, 1.0,
                 0.0,-0.39465,2.03211,
                 1.13983,-0.58060,0.0);


        if (xyf.x < 0.25)
          gl_FragColor = vec4(yuv2rgb*yuva, 0.0);
        else if (xyf.x < 0.5)
          gl_FragColor = vec4(yuv2rgb*yuvb, 0.0);
        else if (xyf.x < 0.75)
          gl_FragColor = vec4(yuv2rgb*yuvc, 0.0);
        else
          gl_FragColor = vec4(yuv2rgb*yuvd, 0.0);
}
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: 180


« Reply #161 on: July 27, 2014, 09:07:09 am »

looks nice fromhell!

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

Cakes 31
Posts: 14471



WWW
« Reply #162 on: July 27, 2014, 09:37:54 am »

It's not nice at this point Sad It's supposed to be in color.

and yeah, i am having a bit of a low res fetish right now, I like sharp artwork but I also want to design OA3 for the lower resolution, and I don't like tiny windows or going fullscreen so I did r_tvMode to render the game to 640x480 and scaling that buffer up.   Adding NTSC artifacts on top of this would simulate the game on a TV played through a console system, helping me design ahead for these artifacts.

it's a convoluted asset debug feature really, but could be used for masochistic retro novelty gameplay if one wanted.


Also, sort of related, I have the colorspace conversion bleed part of the shader working (the third pass), check out the red numbers to the bottom for example.


nothing like using modern technology to make a game look older Smiley   Doing it the other way around is akin to polishing a turd because I can't just make a proper normal mapped game out of thin air and still expect to hit the important spec targets.
« Last Edit: July 27, 2014, 10:49:52 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: 180


« Reply #163 on: August 12, 2014, 02:42:57 am »

posting the multipart glsl programs. I modified the EGAfilter and BWfilter postprocessing to work with this new system. I dont think there would be much problems caused by the new system in regards to the earlier postprocessing programs ( as postprocessing programs are packed with the executable so likely the executable will have available to it the programs that it can read).

what this new system does is this:
load default vertex shader source
load initial part of the fragment shader source (definitions of uniforms, variants, define the main function and set color to black)
loop through the r_postprocess string and load each needed fragment shader source code (names of the files to load are in the r_postprocess string, separated by the '+' character) - each of these parts takes 'color' variable as input and after modifying it outputs the 'color' variable for the next part
load the final part of the fragment shader - write 'color' to the gl_FragColor
compile the shader programs

example usage:  /r_postprocess EGAfilter+BWfilter


for the engine source code, TODO: add check that the glsl postprocessing program does not exceed the buffer in size. fail the compilation if it does.

I'll try to finish this soon as it has been a while now.

also, I need advice how to proceed ... for future changes - should I clone sago007's repo, fromhell's or stick to my fork?
In back of my mind there is like a voice telling me Github was made just for that - to make collaborative work easier.. but I dont get it just yet.
Logged
Gig
In the year 3000
***

Cakes 48
Posts: 4198


WWW
« Reply #164 on: August 12, 2014, 06:49:03 am »

(as postprocessing programs are packed with the executable so likely the executable will have available to it the programs that it can read).
IIRC, glsl postprocessing programs are packed into pk3 files. The official site allows you to download both pk3 files and executables at the same time, but that's not always the case.
Currently, it's possible to have 0.8.8 pk3s and 0.8.1 binaries, which should not be a problem, considering glsl isn't supported at all in binaries lower than 0.8.8.

If one starts to try these new glsl programs from you (done for the new post-0.8.8 implementation of glsl -currently only avalable on git as sources, I suppose-) with 0.8.8 binaries, I don't know what will happen. However, I hope it's clear enough this stuff is for testing purposes at the moment, and not to be published in production servers yet.  Smiley
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 31
Posts: 14471



WWW
« Reply #165 on: August 12, 2014, 07:30:07 am »

The Sago fork was done to attempt fixing up travis building (which libxmp regressed).  It is out of date.
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: 180


« Reply #166 on: August 13, 2014, 07:37:21 am »

Hi Gig!

Actually I think I'll add a new postprocessing cvar - r_postprocess_multi. this should keep the things simpler, will make the older programs run on the new build. So if the program was made for the 088 it will work on the new build as well. If both r_postprocess and r_postprocess_multi are specified then one can take precedence - otherwise either of the two being specified is the one that will be executed.
As for the Github.. is just one thing too many for me at the moment to learn. Even though it is probably a simple thing to manage, I dont find the energy to do it. I'll try to do it the old fashioned way- aka have my changes merged to the latest Github version and then post the source code files here on the forum.
As for the production servers.. I just want to finish the basic client glsl functionality, have it working well and give it a 1.0 version. After that, if any other development will ever come from me it will be at a time I'll be able to dedicate both energy and time to it.
These past months even if I was to find the time, I was not up for programming but that's not really something for the forum Smiley

Logged
Hitchhiker
Member


Cakes 11
Posts: 180


« Reply #167 on: August 13, 2014, 01:07:19 pm »

Hi fromhell,

I'm looking at tr_bloom.c and specifically on the part about uploading some 16 'motion' textures. Is this working for you? I ask as I believe 8 texture units could be taken as a limit (some older cards will not know how to handle more than 8 textures. Also, if this is done to have a motion blur effect I think there is a better way of making motion blur (I think someone mentioned doom3 effect which from how I understand it is just a modified godrays shader - I think i can make that effect and it would use the already uploaded framebuffer texture in u_Texture0).

and for Unreal type of tonemapping I would need a texture slot at postprocessing time (to upload the lookup color table)
so I would remove this part:
   if( r_motionblur->integer > 2){
   if (program->u_mpasses > -1) R_GLSL_SetUniform_u_mpasses(program, mpasses);
   GL_SelectTexture(2);
   GL_State( GLS_DEPTHTEST_DISABLE | GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
   GL_Bind( postproc.motion1.texture );
   GL_SelectTexture(3);
   GL_State( GLS_DEPTHTEST_DISABLE | GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
   GL_Bind( postproc.motion2.texture );
   GL_SelectTexture(4);
   GL_State( GLS_DEPTHTEST_DISABLE | GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
   GL_Bind( postproc.motion3.texture );
   GL_SelectTexture(5);
   GL_State( GLS_DEPTHTEST_DISABLE | GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
   GL_Bind( postproc.motion4.texture );
   GL_SelectTexture(6);
   GL_State( GLS_DEPTHTEST_DISABLE | GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
   GL_Bind( postproc.motion5.texture );
   GL_SelectTexture(11);
   GL_State( GLS_DEPTHTEST_DISABLE | GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
   GL_Bind( postproc.mpass1.texture );
   GL_SelectTexture(12);
   GL_State( GLS_DEPTHTEST_DISABLE | GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
   GL_Bind( postproc.mpass1.texture );
   GL_SelectTexture(13);
   GL_State( GLS_DEPTHTEST_DISABLE | GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
   GL_Bind( postproc.mpass1.texture );
   GL_SelectTexture(14);
   GL_State( GLS_DEPTHTEST_DISABLE | GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
   GL_Bind( postproc.mpass1.texture );

please let me know if you agree?

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

Cakes 31
Posts: 14471



WWW
« Reply #168 on: August 13, 2014, 01:11:58 pm »

It's implemented that way as I wanted that motion blur effect to work on everything by delayed rendering into five buffers and then showing the pixel shaded frame after all that, as some lazy workaround for offscreen rendering.


I also have another method by accumulation buffer which isn't as effective but doesn't use fragment shaders.


Also please, PLEASE note that tr_bloom.c is heavily reorganized and sorted into sections now and i'm gonna pause on engine updates for awhile to ease this merging process. I just hope you don't pull out the extra postprocessing option cvars i've done (like r_anime, r_tvMode, r_ntsc, r_leifx).  Some are different from just simply r_postprocessing as I have them operate on the whole context instead of only the refdef and I want to turn those into menu options later.  Granted, they don't really 'enhance' the picture, but they do help the low polyness of the assets appear less uncanny.


and finally be wary of snagging any code from Doom3 or Doom3 BFG.  Those are GPLV3+bethesda clause licensed and will conflict.  I do have a similar shader already as leifx_vgasignal which you could base off of by translating motion vectors into it, the real problem is getting those vectors since cgame would require tearing and it would be dependent on a new cgame module.
« Last Edit: August 13, 2014, 01:20:36 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: 180


« Reply #169 on: August 14, 2014, 03:35:14 pm »

Hi fromhell.

I've had another look and sorry for false alert, no need to remove anything. I was thinking also about a motion blur effect that could work on all cards and think is possible to do (actually it would be rotation blur so different from your effect). If I read your code I think it stores the framebuffers of different frames. If motion blur is done in glsl it will use a single framebuffer (so the effect is different from your and only visible when rotating the view). Anyway, once I get it working in glsl, it could be translated to non-glsl path but for the moment it is just an idea. Basically if one was to take the actual framebuffer and redraw it  - instead of using a single quad but by drawing the quad needed number of times and offsetting it in the correct direction each time (on the same frame) it might give an impression of motion blur (or rather rotation blur).
Anyway... if you wish, please continue working on the tr_bloom.c - not an issue, i'll let you know when I have done all I'd need to do and then I'll merge my changes to your latest version.
As for taking the source from other applications - it is not what I intend to do. I'll make the effect from scratch. I'm not sure what you mean reg. cgame but don't intend to touch it either - no worries. If you mean i.e. camera viewvector between two frames it should not require cgame changes? Need to check it..

r_postprocess still works as before. I've added r_postprocess_multipart for combining multiple effects into a single glsl program ( so this could be used to setup postprocessing using the menus where one would just click which effects one wants). Eventually this new cvar could be made internal to the renderer so it could not be configured from the console but only using the menus.
Logged
special
EXTREMELY SUSPICIOUS TROLL
Nub


Cakes -64556
Posts: 12



« Reply #170 on: September 03, 2014, 07:53:17 pm »

the problem is the retard dickbrain asshole codding it.
Logged
Hitchhiker
Member


Cakes 11
Posts: 180


« Reply #171 on: September 05, 2014, 10:31:49 am »

I guess so.. in fact help would be appreciated  Smiley
Logged
Hitchhiker
Member


Cakes 11
Posts: 180


« Reply #172 on: September 05, 2014, 10:33:58 am »

actually, fromhell, if you want to upload your latest changes I can get the latest files and merge what I have so far. Let me know?
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 31
Posts: 14471



WWW
« Reply #173 on: September 06, 2014, 07:24:23 am »

Just pushed my latest changes which is more of a cleanup
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: 180


« Reply #174 on: September 28, 2014, 03:59:04 pm »

hi, just few minutes ago I finally managed to get everything lit correctly (!!!! Smiley ). So will proceed with cleaning up the mess I made on my copy of the source so merging the changes will not pickup anything that's not needed. After that I'll need to fix the glsl programs to incorporate the lighting and if this goes well I'll be ready to shoot the changed files to you. Hopefully by end of this coming week.
p.s. sorry about the late reply - only saw your last post now.

Logged
Pages: 1 ... 5 6 [7] 8
  Print  
 
Jump to: