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.


Messages - lexected

Pages: [1]
1
Graphics / Re: Texture with mysterious corners
« on: January 07, 2016, 07:37:52 am »
I'm using InkScape. I've read that this could be caused by using premultiplied textures, but I know no more.
How would you call this? What could I type into the search bar? :)

To the other post:
Well, drawing rectangles with rounded corners seemed to be easier with textures. But I did draw those ordinary rectangles as primitives, of course.

I temporarily solved it by replacing alpha with background color. It's not pretty in principle, but it works.

2
Graphics / Texture with mysterious corners
« on: January 06, 2016, 10:18:21 pm »
Hello!

I have been told that this is kind of a common problem with transparent textures, but didn't get any further information on how to solve it.

In my code, I'm trying to render this texture (a square with rounded corners, where rounded corners have some alpha)


What I get instead is this

Notice those greyish places on the corners of the textures - where rounded corners are supposed to be.

What could be causing this? I have a pure-white texture, so I don't expect a single pixel to get any darker than the background. All pixels should have at least the color of background, but as you can see, there is something darker.

Any help would be highly appreciated.

3
Graphics / Re: Unwanted outline appearing on RectangleShape
« on: January 06, 2016, 10:34:05 am »
I'd still like to ask about that alpha problem. What is it? How could one avoid it? setSmooth, antialiasing or some other trick?

4
Graphics / Re: Unwanted outline appearing on RectangleShape
« on: January 06, 2016, 10:09:42 am »
Thank you for your answer.

What is "an alpha problem" and how can it be avoided?

To the untextured shape: I'm not using anti-aliasing. From what I understood from internet, there could be a rounding error of floats in the positions of vertices, but mine seem to be fine to me.

I also didn't mention that I'm rendering contents of a window (both texture and white box) into a RenderTexture, and only then I'm rendering that onto the background rectangle shape in the window.


I'd like to provide a minimal example, but when I tried to reproduce this problem with a new application, it wasn't there.

EDIT:
Ok, I did a bit of further "testing".
I found that those borders aren't there if I overlap two RectangleShapes of the same color.


I am now sure that the problem is in the RenderTexture step. Notice that the characters here are not blured, because I rendered the box directly into the RenderWindow.


EDIT2: SOLVED!
My RenderTexture´s IntRect was smaller (or different) than the size of the texture. That's it.

5
Graphics / Unwanted outline appearing on RectangleShape
« on: January 05, 2016, 09:10:49 pm »
Hello!

I'm using this code
rectangle = new sf::RectangleShape(size);
rectangle->setFillColor(sf::Color::White);
rectangle->setOutlineThickness(0.f);
rectangle->setOutlineColor(sf::Color::Transparent);
rectangle->setPosition(position);
target.draw(*rectangle);
 

and yet I'm experiencing something like this


If you look closer you will see a thin gray border around the white boxes. However, it isn't present everyhere. For example, the third box has no border on the bottom side.

A similar thing happens to my textures applied on RectangleShape


No such thing is visible in Inkscape


Any idea what could be causing this?

6
Graphics / Re: sf::Text for continuous text
« on: January 05, 2016, 06:45:05 am »
Thank you!
It works, although it looks little tricky.

7
Graphics / Re: sf::Text for continuous text
« on: January 04, 2016, 03:05:48 pm »
Sorry.

By continuous text I mean text that goes through several lines constrained by the size of a container it is in. For example, this text is going to get to the second line, because its length exceeded the size limit.

On my screen there's a line break after "this" in the previous sentence, and I didn't put it there - it must have been inserted automatically.

Is there a way to achieve something similar in SFML?

8
Graphics / sf::Text for continuous text
« on: January 04, 2016, 01:19:49 pm »
Hello!

I'd like to ask whether it's possible to display continuous text using sf::Text. I thought I could somehow set the size of a line and then set the text happily, but I haven't found anything saying that it could be done that way...

Does anybody have experience with handling such thing? Is it possible?

Pages: [1]
anything