Shaders

Discuss anything about DraStic here.
User avatar
SSUPII
Posts: 269
Joined: Thu Jul 14, 2016 7:15 am
Location: Bari, Italy
Contact:

Re: Shaders

Post by SSUPII » Mon Mar 26, 2018 1:16 pm

Revildaron wrote:Thanks...
But still same as before... is there still other option to make it work if not can u suggest any shader that i can use that will make drastic look like native ds res...
For that you can use no shaders at all and no high resolution rendering
I watch anime
Spoiler!
Some Pokemon gifs here, nothing important to see
ImageImage

Revildaron
Posts: 12
Joined: Sat Mar 24, 2018 10:26 am

Re: Shaders

Post by Revildaron » Mon Mar 26, 2018 10:30 pm

SSUPII wrote:
For that you can use no shaders at all and no high resolution rendering
That true but it will look worst without antialiasing...the lcd3x provide more look like ds lcd screen without pixel look... if someone dont find solution for lcd3x i think i will give up using that...thanks...

jdgleaver
Posts: 8
Joined: Wed Mar 14, 2018 6:05 am

Re: Shaders

Post by jdgleaver » Tue Mar 27, 2018 5:26 am

Revildaron wrote: That true but it will look worst without antialiasing...the lcd3x provide more look like ds lcd screen without pixel look... if someone dont find solution for lcd3x i think i will give up using that...thanks...
Unfortunately, It looks like the GPU in your tablet has floating point precision issues that can't really be fixed (unless there's a firmware/OS update, or something...). This means that all shaders are going to have rendering problems, particularly those that draw scanlines or grids. This is sad :(

I've attached another version of the 'highp' lcd3x hack which forces *everything* to use high precision variables - I doubt that it will work on your tablet (I'm not even sure if DraStic shaders support explicit declaration like this), but it might be worth a try... Other than that, I'm all out of ideas...
Attachments
lcd3x_highp_v2.zip
hack v2 - untested
(1.1 KiB) Downloaded 186 times

Revildaron
Posts: 12
Joined: Sat Mar 24, 2018 10:26 am

Re: Shaders

Post by Revildaron » Tue Mar 27, 2018 9:21 am

jdgleaver wrote:
Unfortunately, It looks like the GPU in your tablet has floating point precision issues that can't really be fixed (unless there's a firmware/OS update, or something...). This means that all shaders are going to have rendering problems, particularly those that draw scanlines or grids. This is sad :(

I've attached another version of the 'highp' lcd3x hack which forces *everything* to use high precision variables - I doubt that it will work on your tablet (I'm not even sure if DraStic shaders support explicit declaration like this), but it might be worth a try... Other than that, I'm all out of ideas...
Thanks for your effort...
Sadly highp shader could not be load... i think my tablet could not handle it....
I will use default shader that was already included in drastic i think because only that shader working properly... btw do u have crt shader? I cant find it on shader pack...

jdgleaver
Posts: 8
Joined: Wed Mar 14, 2018 6:05 am

Re: Shaders

Post by jdgleaver » Tue Mar 27, 2018 12:00 pm

Revildaron wrote: Sadly highp shader could not be load... i think my tablet could not handle it....
If the shader failed to compile, I think there should be a log file in your shaders directory - probably called lcd3x_highp.log (or maybe just lcd3x.log). If you post the contents of this, I might be able to see what went wrong... (but I don't anticipate having much luck...)

I don't have a CRT shader - and even if I did, your tablet's GPU wouldn't be able to draw the scanlines properly! :(

Revildaron
Posts: 12
Joined: Sat Mar 24, 2018 10:26 am

Re: Shaders

Post by Revildaron » Tue Mar 27, 2018 12:19 pm

jdgleaver wrote: If the shader failed to compile, I think there should be a log file in your shaders directory - probably called lcd3x_highp.log (or maybe just lcd3x.log). If you post the contents of this, I might be able to see what went wrong... (but I don't anticipate having much luck...) :(

In lcd3x.log

0:3: L0001: Typename expected, found 'COMPAT_PRECISION'
0:3: L0001: Expected identifier, found 'vec4'

jdgleaver
Posts: 8
Joined: Wed Mar 14, 2018 6:05 am

Re: Shaders

Post by jdgleaver » Tue Mar 27, 2018 12:31 pm

Revildaron wrote: 0:3: L0001: Typename expected, found 'COMPAT_PRECISION'
0:3: L0001: Expected identifier, found 'vec4'
Oops... OK, I can see where that went wrong...

Please try the new attached version!
Attachments
lcd3x_highp_v3.zip
lcd3x highp hack v3 (untested)
(1.09 KiB) Downloaded 204 times

Revildaron
Posts: 12
Joined: Sat Mar 24, 2018 10:26 am

Re: Shaders

Post by Revildaron » Tue Mar 27, 2018 1:06 pm

jdgleaver wrote: Oops... OK, I can see where that went wrong...

Please try the new attached version!
Screenshot_2018-03-28-01-01-15.png
Screenshot_2018-03-28-01-01-15.png (759.39 KiB) Viewed 2250 times
Same as before i try modified it
Look like this better that before but dot pixel are bigger...


Can u overlook what can fix

<vertex>
attribute vec2 a_vertex_coordinate;
attribute vec2 a_texture_coordinate;
uniform COMPAT_PRECISION vec4 u_texture_size;

varying COMPAT_PRECISION vec2 v_texture_coordinate;

void main()
{
gl_Position = vec4(a_vertex_coordinate.xy, 0.0, 1.0);
v_texture_coordinate = a_texture_coordinate;

}
</vertex>

<fragment>
#ifndef BRIGHTEN_SCANLINES
#define BRIGHTEN_SCANLINES 16.0
#endif
#ifndef BRIGHTEN_LCD
#define BRIGHTEN_LCD 4.0
#endif

uniform COMPAT_PRECISION sampler2D u_texture;
uniform COMPAT_PRECISION vec4 u_texture_size;

varying COMPAT_PRECISION vec2 v_texture_coordinate;

const COMPAT_PRECISION float brighten_scanlines = BRIGHTEN_SCANLINES;
const COMPAT_PRECISION float brighten_lcd = BRIGHTEN_LCD;
const COMPAT_PRECISION vec3 offsets = 2.0 * vec3(1.0/2.0, 1.0/2.0 - 2.0/3.0, 1.0/2.0 - 4.0/3.0);

void main()
{
COMPAT_PRECISION vec2 omega = 2.0 * 2.0 * u_texture_size.zw;
COMPAT_PRECISION vec3 res = texture2D(u_texture, v_texture_coordinate).rgb;
COMPAT_PRECISION vec2 angle = v_texture_coordinate * omega;

COMPAT_PRECISION float xfactor = (brighten_scanlines + sin(angle.x)) / (brighten_scanlines + 1.0);
COMPAT_PRECISION vec3 yfactor = (brighten_lcd + sin(angle.y + offsets)) / (brighten_lcd + 1.0);

COMPAT_PRECISION vec3 color = xfactor * yfactor * res;

gl_FragColor = vec4(color, 1.0);
}
</fragment>

jdgleaver
Posts: 8
Joined: Wed Mar 14, 2018 6:05 am

Re: Shaders

Post by jdgleaver » Wed Mar 28, 2018 5:14 am

Revildaron wrote: Same as before i try modified it
Look like this better that before but dot pixel are bigger...
By replacing PI with 2.0, you've just changed the 'scanline' spacing. This doesn't fix the problem... Look at how the lines become more uneven as you go towards the right/bottom of the screen: this is because the coordinate values are getting larger, and so too are the rounding errors caused by the 'bad' GPU in your tablet.

I'm sorry to say this, but I think you'll have to admit defeat... :(

(If it were me, I'd sell the Samsung and get something else!!!)

Revildaron
Posts: 12
Joined: Sat Mar 24, 2018 10:26 am

Re: Shaders

Post by Revildaron » Wed Mar 28, 2018 7:43 am

jdgleaver wrote:
Revildaron wrote: Same as before i try modified it
Look like this better that before but dot pixel are bigger...
By replacing PI with 2.0, you've just changed the 'scanline' spacing. This doesn't fix the problem... Look at how the lines become more uneven as you go towards the right/bottom of the screen: this is because the coordinate values are getting larger, and so too are the rounding errors caused by the 'bad' GPU in your tablet.

I'm sorry to say this, but I think you'll have to admit defeat... :(

(If it were me, I'd sell the Samsung and get something else!!!)
I know i give up...
i got this tab from my sister if not i already sell it...
I actually using zenfone 5 that was small but support most shader here without flaw but lagging a little bit and that lcd3x working charm.... so zenfone 5 is better than tab6...

Post Reply