Giter Site home page Giter Site logo

i feel sad about opengl-gravity-simulator HOT 4 CLOSED

fad9-TVT avatar fad9-TVT commented on September 16, 2024
i feel sad

from opengl-gravity-simulator.

Comments (4)

carl-vbn avatar carl-vbn commented on September 16, 2024

Huh, that's weird... What hardware are you running on? (CPU & GPU model? amount of RAM?)

from opengl-gravity-simulator.

fad9-TVT avatar fad9-TVT commented on September 16, 2024

Huh, that's weird... What hardware are you running on? (CPU & GPU model? amount of RAM?)

i5-5200U 8GB AMD Radeon R7 M270

from opengl-gravity-simulator.

carl-vbn avatar carl-vbn commented on September 16, 2024

Let's try to remove some unessential features to see if they are causing the issue. If you are running the program build, navigate to where the .exe is located. You should have a shaders folder. If you are building the program from source, navigate to the root of the project, and you should also have a shaders folder there.
Open shaders/postprocessing/fragmentShader.glsl in a text editor and replace all its content with this:

#version 330 core
out vec4 FragColor;

in vec2 TexCoords;

uniform sampler2D ScreenTexture;
uniform sampler2D EmissionTexture;

void main()
{
    const float gamma = 2.2;
    const float exposure = 1.0;
    vec3 hdrColor = texture(ScreenTexture, TexCoords).rgb;
    vec3 result = vec3(1.0) - exp(-hdrColor * exposure);   
    result = pow(result, vec3(1.0 / gamma));
    FragColor = vec4(result, 1.0);
}

and then open shaders/stars/fragmentShader.glsl and replace its content with this:

#version 330 core

// STAR SPHERE FRAGMENT SHADER

// Interpolated values from the vertex shaders
in vec3 Normal_cameraspace;
in vec2 uv;

// Ouput data
layout(location = 0) out vec3 color;
layout(location = 1) out vec3 emission;

void main() {
    color = vec3(0);
    emission = vec3(0);
}

that should get rid of the bloom effect and stars which should speed things up. If this doesn't change anything then the problem is not related to the speed of your GPU and might be a driver issue.

from opengl-gravity-simulator.

fad9-TVT avatar fad9-TVT commented on September 16, 2024

Thanks, the program can run smoothly now, and i can add some function to the modified shader. I am also interested in computer graphics and machine learning, and I am looking forward to your new program.

from opengl-gravity-simulator.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.