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

Pages: [1]
Graphics / Re: Too big textures...
« on: August 06, 2013, 10:50:42 pm »
If I were you I`d implement a streaming system on a separate thread, and implement the offscreen big texture essentially like a queue, so what`s needed would replace the one that`s not, if this is possible in your context then it would be a nice addition in terms of memory, and perhaps speed. :)

Graphics / Re: Too big textures...
« on: August 06, 2013, 08:28:08 pm »
What about chopping that big texture that`s becoming a problem into smaller ones, like 1024*1024 or whatever works for you? And have some sort of container besides those containing what is where, then referencing that through it? Just my 2 cents tho.

Graphics / Re: SFML Text rendering in a deferred context
« on: August 06, 2013, 08:25:01 pm »
I guess I`m the classic RTFM case. :) Thanks for the clarification!

Graphics / Re: Using pure openGL is super slow?
« on: August 06, 2013, 06:40:30 pm »
Those coordinates are simple cartesian coordinates ranging from -1 to 1, and such are the quarters distributed (so ++ is the first quarter, +- is the second, -- is the third and -+ is the fourth). You are filling the first quarter here with your quad, that`s why the entire top right quarter of the screen is filled.

Of course once you set up a MVP matrix enviroment this changes, and your camera code handles these transformations from world space to view space.

Graphics / Re: SFML Text rendering in a deferred context
« on: August 06, 2013, 06:31:53 pm »
A few, for my FBOs, although I thought that pushing/popping states or reseting them would mean that they aren`t interfering with this, and I`d like to keep them active. :) Although every other rendering (sprites, shapes, etc.) works, so I guess I`ll just integrate libRocket now. Thanks for the help. :)

Graphics / Re: SFML Text rendering in a deferred context
« on: August 06, 2013, 06:18:38 pm »
Thanks for the quick reply! Unfortunately that doesn`t solve my problem, or I`m doing something wrong. :( It`s funny though how I can render stuff like shapes without any problem.

Graphics / SFML Text rendering in a deferred context
« on: August 06, 2013, 05:43:54 pm »
I have managed to implement a very simple deferred renderer by going through the interwebs, but it seems to kill my text rendering, which worked well in a forward rendering context. I don`t know what could be causing it, if anyone could give me any insight on this, I would really appreciate it. :) I`m pretty sure it has to do with one or more GL state, but I can`t seem to figure out which one.

It goes something like this . . .

And here`s how I try to draw my string :

glBindBuffer(GL_ARRAY_BUFFER, 0);
                (*FPSText).setString("FPS : " + int2Str((int)FPS));

Any ideas?

Graphics / Re: GLSL Texture mapping problems
« on: August 06, 2013, 05:38:06 pm »
Nope, I wrote myself a class to handle shaders manually, I really feel like SFML`s shader class was intended for pure SFML applications (quite obvious and rational choice). I still use SFML for other purposes though. :)

High quality work, voted. Good luck with the development and the marketing. :D

Graphics / GLSL Texture mapping problems
« on: August 02, 2013, 11:49:20 am »
Hello there! I`m trying to implement texture mapping on a 3D object in OpenGL based on the tutorials at http://ogldev.atspace.co.uk/. I got stuck at the texture mapping part, I`m sure I missed core concepts since I`m a beginner with OpenGL/GLSL, but I can`t seem to find where, I was hoping you could help me out a bit. :) I`m getting a GL_INVALID_OPERATION error when I try to run my code, I can`t seem to manage to put the texture in the right place. Here is my revelant code :

[EDIT] I still don`t know what the problem was, but after writing my own shader reader/compiler everything works just fine. :)

int _tmain(int argc, char** argv)
/// ...


    glViewport(0, 0, window.getSize().x, window.getSize().y);
        glClearColor(0.4f, 0.6f, 0.9f, 0.0f); // cornflower blue :)

        sf::Shader shader;
        shader.loadFromMemory(pVS, pFS);

        sf::Texture test2;
        shader.setParameter("gSampler", test2);

// ... in the game loop
Render(shader, test2);

                glBindBuffer(GL_ARRAY_BUFFER, 0);
                FPSText.setString("FPS : " + int2Str((int)FPS));


Here is the render function



        static float Scale = 0.0f;

    Scale += 0.1f;

        glm::mat4 ProjectionMatrix = getProjectionMatrix();
        glm::mat4 ViewMatrix = getViewMatrix();
        glm::mat4 ModelMatrix = glm::mat4(1.0);
        glm::mat4 MVP = ProjectionMatrix * ViewMatrix * ModelMatrix;

        glUniformMatrix4fv(gWVPLocation, 1, GL_TRUE, glm::value_ptr(MVP));

    glBindBuffer(GL_ARRAY_BUFFER, VBO);
    glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), 0);
    glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)12);

    glDrawElements(GL_TRIANGLES, 12, GL_UNSIGNED_INT, 0);



And finally the shaders (Which are identical with the ones the tutorial provides but meh)
static const char* pVS = "                                                          \n\
#version 330                                                                        \n\
layout (location = 0) in vec3 Position;                                             \n\
layout (location = 1) in vec2 TexCoord;                                                                                         \n\
uniform mat4 gWVP;                                                                  \n\
out vec2 TexCoord0;                                                                 \n\
void main()                                                                         \n\
{                                                                                   \n\
    gl_Position = gWVP * vec4(Position, 1.0);                                       \n\
    TexCoord0 = TexCoord;                                                                                                                       \n\

static const char* pFS = "                                                          \n\
#version 330                                                                        \n\
in vec2 TexCoord0;                                                                                                                                      \n\
out vec4 FragColor;                                                                 \n\
uniform sampler2D gSampler;                                                                 \n\
void main()                                                                         \n\
{                                                                                   \n\
        FragColor = texture2D(gSampler, TexCoord0.st);                                          \n\

I can`t seem to see my error, could you help me out? :)

Pages: [1]