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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - pvallet

Pages: [1]
1
Graphics / Loading indexed images with transparency
« on: June 06, 2017, 12:06:12 pm »
Hello everybody,

I'm working on a SFML + OpenGL project that uses age of empires sprites (with indexed colors) and transparency. However when loading the images some weird artifacts appear. The alpha channel seems to modify the rgb channel on loading.

This is an OpenGL render without glblend where the texture behaves as expected: the transparent pixels have a black color.

See aoe1.png (I'm sorry I don't know how to integrate the image in the post).
The palette can be seen on aoe1_palette.png

But when using age of empires 2 palette, it gives some blue color to the transparent background, as seen on aoe2.png
The palette is aoe2_palette.png

Note that the color of the background is not present on the palette (even though some are close). The same effect appears with a custom palette.

It does work with unindexed color though, and I'll eventually come to using it, but I feel like it's a huge waste of space.

Edit: I'm using SFML 2.4.2 and the bug appears on Linux, Mac OS and Windows

Thanks in advance for your help !

Paul

2
Window / gl Viewport oddly translated downwards when using fullscreen
« on: November 15, 2016, 06:07:19 pm »
Hello everybody,

I came across an odd problem while using fullscreen with the SFML:

Sometimes when launching my program, the gl viewport turns out translated downwards, leaving a black strip on the top. (about 50% of the time everything works fine). Here is a picture attached to illustrate it.

I create my window using
sf::ContextSettings context(24, 8, 4, 3, 0);
sf::RenderWindow window(sf::VideoMode::getFullscreenModes().front(), "OpenGL", sf::Style::Fullscreen, context);

The fullscreen mode is always 1366x768x32. When the problem appears, the size of the sf::View associated with the sf::RenderWindow is cropped to 1366x715, which translates the FPS counter but keeps the minimap whole (not cropped on the bottom).

When I click, OpenGL handles my click as if it was translated downwards, too, even on the minimap.

Changing the view or the size of the window only changes how the 2D elements are draw, the black strip on the top stays unchanged.


Would you have any idea on how to fix this ?


Thanks

Pages: [1]