SFML community forums

Help => Graphics => Topic started by: Predator106 on November 14, 2012, 07:15:58 am

Title: Frag shader input texture pixels seem...all empty? gltrace included
Post by: Predator106 on November 14, 2012, 07:15:58 am

the tilemap_pixels is a 50x100 image of every pixel being color.r = 150, as you can see. the saved image on disk confirms that as well..the result from the shader is an all-green image though. and i tried playing with the coordinates and all kinds of things. it leads me to believe that it simply isn't sending it like it should. i'm not getting any warnings like it isn't being loaded or anything, and this method is in fact being run...

shader code: http://pastie.org/5375234

what i set in my game..
            image.setPixel(x, y, sf::Color(150, 0,0));
            ++x;
        }
        ++y;
        x = 0;
    }

    image.saveToFile("test999999.png");
    std::cout << "image size, width: " << image.getSize().x << " height: " << image.getSize().y << "\n";
    sf::Texture texture;
    texture.loadFromImage(image);
    m_shader->setParameter("tilemap_pixels", texture);
 

here's a gltrace from glsldevil, that's the best kind of "debugging" i can find...
http://fpaste.org/WIoZ/
Title: Re: Frag shader input texture pixels seem...all empty? gltrace included
Post by: Laurent on November 14, 2012, 07:54:09 am
Can you please post a complete and minimal code that reproduces the problem?
Title: Re: Frag shader input texture pixels seem...all empty? gltrace included
Post by: Predator106 on November 14, 2012, 08:29:30 pm
Again, totally my mistake. I need to just default to trying to make a test case...turns out I didn't have the image/texture on the heap, which i was passing to the shader, so it was nonexistent..