Android random function in fragment shader

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
sabadyCZ
Prole
Posts: 9
Joined: Sat May 02, 2015 6:13 pm
Location: Czech Republic
Contact:

Android random function in fragment shader

Post by sabadyCZ »

Hi,
I really don't know, where can be a problem. I want to create a starfield in the background of the scene, but on some android devices this method doesn't work at all.

Here is a random function in fragment shader:

Code: Select all

float rand(vec2 co){
    return fract(sin(dot(co.xy ,vec2(1.9898,1.233))) * 43758.5453);
}
If I remove fract function, it draw something, otherwise it doesn't draw anything. Is there any other way to make random function or something like that?

On a PC and Samsung galaxy mini 2 it works, there isn't any problem, but LG G2 and Samsung Galaxy S3 not. So that is really strange. I'm using a LOVE for android from google play.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests