Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Outdated openGL?  (Read 1439 times)

0 Members and 1 Guest are viewing this topic.

Bloob

  • Newbie
  • *
  • Posts: 13
    • View Profile
Outdated openGL?
« on: August 13, 2014, 06:04:30 pm »
Today I tried to test my game on my friends computer but we ran into a few errors.

his gfx card : gtx 650 ti boost



my shader...
uniform sampler2D texture;

uniform float distanceToMaxNoise = 1000.0;
uniform float startNoiseDistance = 5000.0;

uniform vec2 position = vec2(0,0);
uniform float random = 1.0;

highp float randFloat(vec2 co)
{
    highp float a = 12.9898;
    highp float b = 78.233;
    highp float c = 43758.5453;
    highp float dt= dot(co.xy ,vec2(a,b));
    highp float sn= mod(dt,3.14);
    return fract(sin(sn) * c);
}

void main()
{
        vec2 texCoord = gl_TexCoord[0].xy;
        vec2 randomVec = vec2(random);
        vec2 texCoordRandom = texCoord + randomVec;
    vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);

        highp float randomNoise = randFloat(texCoordRandom);
        highp float randomLine = randFloat(texCoord.yy + randomVec);

        float distance = clamp(length(position) - startNoiseDistance, 0.0, distanceToMaxNoise);
        float noise = clamp(distance / distanceToMaxNoise, 0.0, 1.0);

        pixel = mix(pixel, vec4(randomNoise, randomNoise, randomNoise, 1.0), noise);

        if(randomLine < 0.02)
        {
                pixel = mix(pixel, vec4(0.0, 0.0, 0.0, 1.0), noise);
        }

        gl_FragColor = pixel;
}

from what i can tell #version 120 is from 2006 so does that mean his GFX card is outdated? If this happens on his computer i think its likely that other computers will experience the same problem. Is there something I can do that will automatically address the problem by prompting the user to update their drivers or something?

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Outdated openGL?
« Reply #1 on: August 13, 2014, 07:32:51 pm »
When you create your window you can pass in the ContextSettings you require.
You can then call getSettings to check that you got what you needed and tell the user if you did not. You could also selectively disable or degrade things (like certain shaders) if your didn't get what you asked for but have alternatives you can then use instead.
« Last Edit: August 13, 2014, 07:34:57 pm by Jesper Juhl »

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Outdated openGL?
« Reply #2 on: August 14, 2014, 02:15:32 am »
GLSL is just like any other high level language. It is written as a standard and standards change over time. You should really just read and try to understand what that warning is telling you if you really want to make use of GLSL.

This might also help, like all other documentation that is available.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).