• Breaking News

    OpenGL Fragment Shader Reading Color Data I am having difficulties trying to understand how a fragment shader (GLSL) works in OpenGL. To be more specific, how does OpenGL reads the color/texture data? In the vertex Shader (GLSL) there is a pre-defined variable that sets the vertex data called gl_Position. So basically I am asking, what is the variable/method that sends color/texture data to the OpenGL program in the fragment shader or do i just type out vec4 fragColor; does that work? (above code) https://ift.tt/eA8V8J

    I am having difficulties trying to understand how a fragment shader (GLSL) works in OpenGL. To be more specific, how does OpenGL reads the color/texture data? In the vertex Shader (GLSL) there is a pre-defined variable that sets the vertex data called gl_Position. So basically I am asking, what is the variable/method that sends color/texture data to the OpenGL program in the fragment shader or do i just type out vec4 fragColor; does that work? (above code)

    from GameDev.net https://ift.tt/2CU61s1

    ليست هناك تعليقات

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728