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

Pages: [1] 2 3
1
BUMP

2
Nope. Device manager shows just: NVIDIA Geforce GTX 1060 6GB

3
Hi, I have been working on game for awhile using visual studio and SFML. I do not have any problems running the game in either debug or release mode within visual studio. However, if I grab the exe and dlls and try to run it outside of the development environment, things get weird. It can load some textures, but if it loads a decent amount, I get a sudden spike to 100 percent "3d" on my GPU and the game crashes with out of memory errors when loading textures. I have included a screenshot as the first attached image. I am bothered because when other people run my game on their computers, they do not have this issue. I don't understand how the game works normally in the dev environment on my computer, and also on other people's computers outside of the dev environment, but not on mine. The 2nd image shows what the GPU looks like while loading textures while I run the build in visual studio. Does anyone have any ideas why this could be happening? It seems extremely bizarre. I have updated my graphics drivers but do not know how else to proceed. Any help is massively appreciated!

4
Graphics / Re: Shader uniform not updating?
« on: January 03, 2022, 05:40:30 am »
What does this mean for me? Does that just mean its something I have to work around?

Thanks for the response.

5
Graphics / Shader uniform not updating?
« on: January 03, 2022, 04:46:30 am »
I am having an issue that probably stems from some misunderstanding of sf::Shader::CurrentTexture, but I am very confused.

This code sets the texture in my shader correctly, and everything works.

pShader.setUniform("u_texture", *texture);

However, I had a bug in part of my code for awhile where it wasn't working, and I couldn't figure out why. After investigating a bit, I found that I had set the texture parameter earlier like this.

pShader.setUniform("u_texture", sf::Shader::CurrentTexture);

But my understanding of uniforms is that I can freely update them. Running this code:

pShader.setUniform("u_texture", sf::Shader::CurrentTexture);
pShader.setUniform("u_texture", *texture);

the second line is ignored completely, and the texture doesn't get set correctly. Can someone explain this to me?

6
Graphics / Failed to load image. Reason: Out of memory
« on: October 27, 2020, 10:12:25 pm »
Hi. I am developing a game with SFML, and I'm running into a memory issue that I don't understand. If I load too much memory in textures, I get a message "Failed to load image. Reason: Out of memory" from SFML. The reason that this is confusing is I feel like I'm using significantly less memory than should cause this issue. I have a modern computer with a solid graphics card (NVIDIA GeForce GTX 1060 6GB). I have written a small program to demonstrate my issue. Using the formula 2048x2048x4x(number of textures) to figure out roughly how much memory I've used, it crashes at around 1700 MB, or 100 textures of size 2048x2048. Not sure if the number is right. Does anyone know what I'm doing wrong or what this issue is?

#include <iostream>
#include <SFML\Graphics.hpp>
#include "Tileset.h"
#include <SFML/OpenGL.hpp>

using namespace std;
using namespace sf;

const static int NUM_TEX = 1000;

int main()
{
        Texture *texs[NUM_TEX];

        string thing = "goal_w1_b_512x512.png";

        int x;
        for (int i = 0; i < NUM_TEX; ++i)
        {
                Texture *tex = new Texture();
                if (!tex->loadFromFile(thing))
                {
                        delete tex;
                        cout << "failed to load: " << thing << "\n";

                        cin >> x;

                        return 0;
                }

                int num = tex->getSize().x * tex->getSize().y * 4 * i;
                double memD = num;
                double megs = memD / 1000000.0;
                cout << "megs: " << megs << endl;

                texs[i] = tex;
                cout << i << "\n";
        }


        for (int i = 0; i < NUM_TEX; ++i)
        {
                delete texs[i];
        }
       
        cout << "done" << endl;

        cin >> x;
       

        return 0;
}



7
Is there no help to be found for this? I tested on FFMPEG with ffplay.exe and it plays the video until the end. But sfemovie just can't seem to. Would really like some assistance :(

8
General / Using sfemovie, the ending of the movie is always cut off
« on: April 03, 2019, 11:45:52 pm »
There isn't really a forum for sfemovie so I figured this was my best chance at finding an answer. I am using the newest sfemovie along with SFML 2.4.2.

They include a demo with their library called sfeMovieDemo and thats what I'm using to test this movie.

Here is a link to the mp4 movie, which is a large particle effect type thing:

https://www.dropbox.com/s/kjhnfdie9xmteqe/nexus_core_02.mp4?dl=0


The movie stops maybe half a second to a second before its ending when played with sfeMovie and I get this debug message:

Debug: C:\Users\ficti\Documents\Libs\sfeMovie-master\src\VideoStream.cpp:239: sfe::VideoStream::getSynchronizationGap() - failed computing synchronization gap for video stream, it may become out of sync

I don't really understand the message so I'm hoping someone else does.

Any ideas?

Here is a screenshot showing the final frame played in sfeMovie(left) vs the final frame played in the default windows player(right)



9
I modified my code to do pretty much what yours does fallahn, where the main thread is loading, and there is a separate drawing thread. The first time in my program that I run it, there is no flicker, but if I exit a level and run it again, I get the flicker immediately when starting up the drawing thread, even with no loading occurring. It is so frustrating to me that no one can tell me what is going wrong or replicate the flicker, since no matter what I do it seems to happen somehow with no explanation. I feel like if I knew what was causing the flicker normally, I would be able to fix it. Why is no one else able to replicate it? I just want to know what is happening. It feels like my project is stuck until I figure this out :\

10
This would imply that there's not really a way to load stuff in the background while having a smooth visual experience though. I'm trying to not have any skips while transitioning between levels, and I want a smooth transition between a level, the loading screen, and the next level. Is there no way to do that, even if I use the secondary thread to draw and load the resources in the main thread?

11
Thank you for the response. I wasn't aware/thinking about the global variables, sorry about that. I don't use them in my original program and didn't think about it for the example.

On my end I also replaced boost thread with std thread, and also fixed the globals, but I still get the same issues. Just confirming that.

I have now read the page on the openGL contexts, but I'm a little confused how I would implement what they are saying here. I am rendering on my main thread and then just doing shader loading/other stuff in my secondary thread. How would I use contexts in relation to this? I guess I'm not fully wrapping my head around what kind of adjustments I should make.

it also seems like the rendertexture and renderwindow require context activation separately, but I don't see how the shader ties in to those and which one it ties into or when to activate/deactivate. Thanks for helping me out with this.

12
Okay, I've come back to this problem after a little break and ran the last code I posted again, and realized it did in fact replicate the flicker! Just happens intermittently (like almost every time but not all, and size of the flicker is different each time). I cut off some of the fat from my example to reduce it down to the bare minimum. The 2 second sleep is there to show that the flicker happens immediately after the 2 seconds are up, aka it occurs when the shader load happens. Also, the shader involved doesn't matter, it can be a blank fragment shader but it needs to exist.

Here is a slow motion gif of what is happening. It is very frustrating to see this so often and not know what to do to fix it! (Its very slowed down. The real timing is a 1 frame flicker)

https://gfycat.com/ComfortableDigitalAssassinbug

I am using boost 1_59_0 and sfml 2.4.2 and this is a release build

#include <SFML/Graphics.hpp>
#include <boost/thread.hpp>
#include <iostream>

boost::thread *loadingThread;
sf::Texture tex;
sf::RenderWindow *window;

using namespace sf;
using namespace std;

RenderTexture *preScreenTex;

sf::Shader speedBarShader;

void Load()
{
        sleep(sf::seconds( 2 ));

        if (!speedBarShader.loadFromFile("speedbar_shader.frag", sf::Shader::Fragment))
        {
                cout << "speed bar SHADER NOT LOADING CORRECTLY" << endl;
        }

        while (true);
}

int main()
{

        window = new RenderWindow(sf::VideoMode(1920, 1080), "Breakneck", sf::Style::Fullscreen);
        window->setVerticalSyncEnabled(true);
        preScreenTex = new RenderTexture;
        preScreenTex->create(1920, 1080);
        preScreenTex->clear();

        int frame = 0;
        bool quit = false;
        sf::Event ev;
        loadingThread = NULL;

        while (!quit)
        {
                while (window->pollEvent(ev))
                {

                }

                preScreenTex->clear(Color::Black);
                window->clear(Color::Red);

                if (loadingThread != NULL)
                {
                        preScreenTex->clear(Color::Green);
                }

                if (frame == 60 * 3)
                {
                        loadingThread = new boost::thread(&Load);
                }

                preScreenTex->display();
                sf::Sprite spr;
                spr.setTexture(preScreenTex->getTexture());
                window->draw(spr);
                window->display();

                ++frame;
        }

        return 0;
}


 

13
EDIT: new code below and better description

14
I can try to set up a minimalistic version of what is happening. I wasn't even aware it was possible for something like this to happen. Is it possible to give me maybe even an option of what could be happening to allow the red to still show after clearing it to yellow and drawing on it?

15
Hi. What I am doing is using boost threads to load textures and data off the disk while I have a simple update loop for sfml which draws the loading screen. I am having an odd issue that happens only while this second thread is loading.

my code is basically

1.clear render texture to black
2.clear window to red
3. clear window to yellow
4. draw loading screen to texture
5. display texture
6. draw displayed texture to window
7. display window

what I get is the loading screen drawing, but with intermittent and randomly sized strips of the screen which will flash yellow and red (sometimes a yellow bar with a red bar on top of/below  it, sometimes only one color). This doesn't make any sense to me. If if clear the window to yellow it should not have any red left, but this issue keeps happening. Sometimes its a thin strip (its always the entire width of the screen) and sometimes its the entire screen. It just flickers those colors for a split second.

This just seems completely counter to my understanding of how the window is filled w/ pixels. VSync is off and the only time this ever happens is when using the secondary thread. For reference, I'm not using the window or the render texture that I draw my loading screen to in the loading thread.


What gives??? Anyone have any idea how this could happen? I've been frustrated for awhile and finally resorted to posting about it.

Pages: [1] 2 3