-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get gl display method working, at least, minimally, with the scanline…
…s shader. someone else can fix up the others if they need to or make me a bug. at least the hard part is past
- Loading branch information
Showing
3 changed files
with
59 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//Yeah, I'm sorry this uses really old non-generic attributes | ||
//that's just how old this code is; support on ancient graphics cards is helpful | ||
|
||
#ifdef VERTEX | ||
uniform mat4 modelViewProj; | ||
|
||
void main() | ||
{ | ||
gl_Position = modelViewProj * gl_Vertex; | ||
gl_TexCoord[0] = gl_MultiTexCoord0; | ||
} | ||
|
||
#endif | ||
|
||
#ifdef FRAGMENT | ||
|
||
uniform float uIntensity; | ||
uniform sampler2D s_p; | ||
|
||
uniform vec2 output_size; | ||
|
||
void main() | ||
{ | ||
vec2 vTex = gl_TexCoord[0].xy; | ||
vec4 temp = texture2D(s_p,vTex); | ||
vec2 wpos = gl_FragCoord.xy; | ||
if(floor(wpos.y/2.0) != floor(wpos.y)/2.0) temp.rgb *= uIntensity; | ||
gl_FragColor = temp; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Despite using the "cgp" derived "retro shader" approach, we're doing things a bit different than retroarch. | ||
|
||
A single .cgp file is used for any graphics backend. The shader references inside it can be written extensionless, or with .cg (or with .hlsl or .glsl for reasons, read on) | ||
|
||
In case you have shaders that work only GLSL or HLSL -- well, they simply won't work in the wrong mode. | ||
In that case, try something like bizhawkdir/Shaders/myshaders/glsl/mybadshader.cgp | ||
In this case, the .cgp can reference .glsl shaders internally. | ||
|
||
An important point, which you will perceive by checking out the bizhawk shaders, is that a .cgp is now portable due to the extension-ignorant behaviour AND the separate .glsl and .hlsl extensions. | ||
(For instance, BizScanlines.cgp+BizScanlines.hlsl+BizScanlines.glsl). | ||
The separate extensions let there be separate shaders for each backend, each referenced by the same cgp which references .cg (arbitrarily; it could be blank) | ||
However if the .cgp referenced a .glsl, it wouldn't work on D3D. | ||
|
||
In case you haven't pieced it together yet, this means there is no automatic mechanism for transpiling shaders. It isn't reliable and created an unmaintainable, slow, mess. | ||
|
||
Porting shaders from retroarch will require touching them extensively, probably. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters