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

Author Topic: Frag shader input texture pixels seem...all empty? gltrace included  (Read 1523 times)

0 Members and 3 Guests are viewing this topic.

Predator106

  • Newbie
  • *
  • Posts: 43
    • View Profile

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/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Frag shader input texture pixels seem...all empty? gltrace included
« Reply #1 on: November 14, 2012, 07:54:09 am »
Can you please post a complete and minimal code that reproduces the problem?
Laurent Gomila - SFML developer

Predator106

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Frag shader input texture pixels seem...all empty? gltrace included
« Reply #2 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..

 

anything