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 - Stauricus

Pages: 1 2 3 [4] 5 6 ... 25
46
then probably it is. thanks for the helo  :)

47
nice. at least loading such texture won't be a real concern in most hardware, then.
I have an integrated graphics board, Intel HD Graphics 620. the maximum texture size is exactly 16384.

interestingly, if I cut textures sizes by half, the problem still persists (big_tex: 8192, 8192; small_tex: 2048, 2048):
Quote
big_tex loading time: 3089ms
small_tex[0] loading time: 41ms
small_tex[1] loading time: 13ms
small_tex[2] loading time: 27ms
small_tex[3] loading time: 13ms
small_tex[4] loading time: 10ms
small_tex[5] loading time: 12ms
small_tex[6] loading time: 10ms
small_tex[7] loading time: 11ms
small_tex[8] loading time: 12ms
small_tex[9] loading time: 12ms
small_tex[10] loading time: 12ms
small_tex[11] loading time: 12ms
small_tex[12] loading time: 11ms
small_tex[13] loading time: 11ms
small_tex[14] loading time: 12ms
small_tex[15] loading time: 42ms

total small_tex loading time: 268ms


but if I cut it down by half again, the values get very close (big_tex: 4096, 4096; small_tex: 1024, 1024):
Quote
big_tex loading time: 58ms
small_tex[0] loading time: 15ms
small_tex[1] loading time: 3ms
small_tex[2] loading time: 3ms
small_tex[3] loading time: 3ms
small_tex[4] loading time: 3ms
small_tex[5] loading time: 3ms
small_tex[6] loading time: 3ms
small_tex[7] loading time: 2ms
small_tex[8] loading time: 3ms
small_tex[9] loading time: 3ms
small_tex[10] loading time: 3ms
small_tex[11] loading time: 3ms
small_tex[12] loading time: 3ms
small_tex[13] loading time: 2ms
small_tex[14] loading time: 2ms
small_tex[15] loading time: 2ms

total small_tex loading time: 63ms

would you guys mind testing with your respective Texture::getMaximumSize()?

although its not a bug, preliminarly findings suggest that using the max and 2nd max texture sizes (considering powers of two) may be too unpractical

48
yep, 2.5.1
I got these values in the last run

Quote
big_tex loading time: 179784 ms
small_tex[0] loading time: 8844 ms
small_tex[1] loading time: 43 ms
small_tex[2] loading time: 49 ms
small_tex[3] loading time: 61 ms
small_tex[4] loading time: 57 ms
small_tex[5] loading time: 60 ms
small_tex[6] loading time: 61 ms
small_tex[7] loading time: 63 ms
small_tex[8] loading time: 60 ms
small_tex[9] loading time: 59 ms
small_tex[10] loading time: 55 ms
small_tex[11] loading time: 57 ms
small_tex[12] loading time: 86 ms
small_tex[13] loading time: 1115 ms
small_tex[14] loading time: 2975 ms
small_tex[15] loading time: 1529 ms

small textures sum is only 15182 ms

49
Graphics / time variation when loading textures of different sizes?
« on: April 03, 2022, 01:38:21 pm »
hello! why does loading a big texture (16384x16384) takes so much more time than loading 16 textures of 4096x4096 (if the sum of the texture sizes is the same in the end)?

in this code:
#include <SFML/Graphics.hpp>
#include <iostream>

int main(){
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML");
    sf::Clock clock;

    sf::Image big_img, small_img;
    sf::Texture big_tex, small_tex[16];
    big_img.create(16384, 16384);
    small_img.create(4096, 4096);

    clock.restart();
   
    big_tex.loadFromImage(big_img);
    std::cout << "big_tex loading time: " << clock.restart().asMilliseconds() << " ms" << std::endl;

    for (int n=0; n<16; n++){
        small_tex[n].loadFromImage(small_img);
        std::cout << "small_tex[" << n << "] loading time: " << clock.restart().asMilliseconds() << " ms" << std::endl;
    }

    return 0;
}

in my computer (not a high-end) it took more than two minutes to load the big texture, and about 15 seconds to load all the small ones. I  suspect it could be something related to the video board needing a contiguous block of memory, but I'm not sure.
anyway, can we somehow take advantage of that to make loading times faster? i tried drawing all the small ones in a RenderTexture, but loading it to a sf::Texture ended up taking much more time (about 5min)  ::)

50
General / Re: Can't compile code from tutorial
« on: March 30, 2022, 12:35:20 pm »
ok, so its probably not about missing dependencies.

are you using some IDE, like Code::Blocks of Visual Studio?

51
General / Re: libgcc_s_sjlj-1.dll was not found code blocks
« on: March 27, 2022, 12:15:20 pm »
hello
how did you install SFML?

52
General / Re: Can't compile code from tutorial
« on: March 26, 2022, 09:29:15 pm »
did you install it trough "apt-get install libsfml-dev"?

53
Graphics / Re: Can I make an array of shapes? If yes, how?
« on: March 25, 2022, 01:47:23 am »
arrays can't be dynamic in size. you probably want a std::vector for that.
you can use like
std::vector<sf::CircleShape> my_circles;

54
the rectangle size is not being correctly set.
after this line
SquareComponent::SquareComponent(Position position) : RectangleShape(sf::Vector2f(SideLen, SideLen)), loc(position)
it is still 0. maybe a more experienced C++ user could explain why. but it works if you manually set it inside the constructor using setSize().

by the way, your Position class is exactly the same as sf::Vector2f, so you could use that.

55
this part seems OK, so i think the problem is in the rest of the code. probably in SquareComponent definitions.

56
Graphics / Re: Using shaders with sfml
« on: February 18, 2022, 04:08:56 pm »
well, 'setuniform' is used to pass variables from SFML to the shader...  :P

57
Graphics / Re: Using shaders with sfml
« on: February 16, 2022, 01:49:26 pm »
Since the linked shader has a big #if around the main body, I wonder whether the version check fails and thus you get no main() function which the compiler expects and as it doesn't find it until the end of the file, it errors with said message.

agreed. thats also why its not finding the variables.

58
Graphics / Re: Using shaders with sfml
« on: February 16, 2022, 11:32:05 am »
I'm a complete ignorant in shaders, but have you tried anothe one, just for testing? I get this error:

Quote
Failed to compile vertex shader:
0:368(1): error: syntax error, unexpected end of file

59
Graphics / Re: unefficient drawing
« on: February 05, 2022, 03:50:50 pm »
also, what is "Sleep(1)"? for how long is it sleeping?
will may have problems when doing it for more than 10 milliseconds.

60
General / Re: Efficient way to draw and get pixels
« on: February 02, 2022, 02:47:04 pm »
well, I had a great conversation with Paul in a topic I made a while ago. We used this GL approach to identify colors in the screen, and get some units ID.
I don't know anythin much faster than that... but what are you trying to do, exactly?

Pages: 1 2 3 [4] 5 6 ... 25
anything