Shader problem on android.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
veethree
Inner party member
Posts: 875
Joined: Sat Dec 10, 2011 7:18 pm

Shader problem on android.

Post by veethree »

Hello. I have 2 shaders in my game. I haven't noticed any issues on PC, But on android one of the shaders doesn't look right. And it appears to get worse the longer the game runs.

Here's the shader in question:

Code: Select all

extern number time;
	extern number strength;
	extern vec2 screen;
	vec4 effect(vec4 color, Image tex, vec2 tc, vec2 sc)
	{
		tc.y = tc.y + sin(  (tc.x * 30.0) + (time * 10.0) ) * (screen.y * 0.0005) * strength;
		return Texel(tex, tc) * color;
	}
"time" is a number between 0 and pi, and strength is a number between 0 and 1.

Here's how it's supposed to look:
1497748392.png
1497748392.png (86.02 KiB) Viewed 1316 times

Here's how it looks on android:
Screenshot_20170618-011137.png
Screenshot_20170618-011137.png (90.61 KiB) Viewed 1316 times


I've attached a .love. The shaders are applied after you run into the cactus that's totally not a reference to a drug.
The shader code is in main.lua, Anything else related to the shader is in game.lua.
Cactus Game.love
(4.9 MiB) Downloaded 75 times
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 38 guests