Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 Sep 2013
Offline Last Active Dec 17 2014 04:31 PM

Topics I've Started

Hitting a milli

12 December 2014 - 12:04 PM

I was wondering if I could get some pointers from everyone on what the best way to approach this would be
I'm looking to build a particle system that can stimulate at least 1 million particles at a time. The more particles the better
I guess I'm really just looking for volume. I mean I know you can have particles that interact with the environment, but I don't believe I can hit that high volume count with particles that can do that.
Just in case this, I'm targeting OpenGL 3.3+ and this is intended for 2D only

Particles: Batching VS instancing

01 December 2014 - 11:39 AM

I was wondering what you guys think the best course of action would be


I'm looking to making a particle system. Currently I have a sprite batcher that can handle rotations, scaling, and etc. It works by mapping a VBO with vertex data I need for the sprites I want to draw. Now I'm wondering should I just build my particle system on top of this? Or should I create a whole new system that uses instancing? Would a instance system even be better, would it even help? I ask because I really do not know that much about instancing


Does any of this change if want to be able to do effects such as rain, snow, fire, smoke?

What if I want the particles to be textured, eg each particle is a different snowflake image?


I'm targeting OpenGL 3.3+ just as fyi too

Super Cool Effects

28 November 2014 - 10:08 AM

I was wondering if anyone could point me to a good starting point or give me a detailed explanation as I'm not really sure where to start. I'm working on a 2D focused game engine which targets OpenGL 3.3+ and I'm wondering how do I do effects?


When I mean effects I'm talking things that glow, fire, power auras, etc



The glowing auras, bullets, anything in this picture

Attached File  geometrywars.jpg   199.05KB   0 downloads


The blue glow of the pylon crystals, the green backs of the banelings, the blue zealot sword glow, the green baneling explosions

Attached File  ss87-hires.jpg   186.38KB   0 downloads


glMapBufferRange and a offset

18 November 2014 - 01:31 PM

EDIT: If it helps I figured out they are drawing right on top of each other, but I don't know why sad.png Maybe my glDraw*** call is messed up? When ever I need to render I use: glDrawElements(GL_TRIANGLES, indicesCount, GL_UNSIGNED_SHORT, NULL). Also I'm using a VAO, which says that my VBO is interleaved and the IBO attached to it


I was wondering if someone could tell me what I'm doing wrong. I can't seem to understand why I'm only able to draw 2 of my 4 quads
So for testing purposes, I have a large VBO that can fit a total of 4 quads in it. I have then split it in half, so each half of the VBO can fit 2 quads (I only lock down one half of the buffer). My problem comes in when try to change the currently bound texture or if I know I'm going to go over the current map range.
My problem is I can only get the last 2 quads to show. The first two do not show at all, I think I might be the way I map my data.
My basic run down is like this:

void MapBuffer()
        offset = 0;
        data = glMapBufferRange(GL_ARRAY_BUFFER, offset, bufferSlice, GL_MAP_WRITE_BIT | GL_INVALIDATE_BUFFER_BIT)
        data = glMapBufferRange(GL_ARRAY_BUFFER, offset, bufferSlice, GL_MAP_WRITE_BIT)

void Draw(GLuint texture, float x, float y, float width, float height)
    if(currTexture != texture || mapIndex+1 > maxMapIndex)
        Render(); // In here I'm using glDrawElements(GL_TRIANGLES, indicesCount, GL_UNSIGNED_SHORT, NULL);
        mapIndex = 0;
        indicesCount = 0;
    //The quads are dynamic so fill the buffer like so:
    ((GLfloat*)data)[mapIndex] = x;
    ((GLfloat*)data)[mapIndex+1] = x;
    ((GLfloat*)data)[mapIndex+2] = z;
    ((GLfloat*)data)[mapIndex+3] = u1;
    ((GLfloat*)data)[mapIndex+4] = v1;
    // Repeat for the remaining vertex data. All the way to ((GLfloat*)data)[mapIndex+19]

    offset += DATA_SIZE_PER_QUAD
    mapIndex += 20;
    indicesCount += 6;

void main()
    const GLfloat DATA_SIZE_PER_QUAD = sizeof(GLfloat) * (3 + 2) * 4; //XYZ and the UV cords for each vertex. Times GLfloat for each corner. So 80 bytes
    int mapIndex = 0;
    int maxQuadCount = 4;
    int maxMapIndex = ((3 + 2) * 4) * maxQuadCount;
    int maxDataSize = maxQuadCount * DATA_SIZE_PER_QUAD;
    int BufferSlice = maxDataSize/2;
    int offset = 0;
    //... Other init code

//... polling event code
MapBuffer(); //Starting map
     Draw(text1, 0, 0, 32, 32);
     Draw(text1, 50, 50, 32, 32);
     Draw(text2, 100, 100, 32, 32);
     Draw(text2, 150, 150, 32, 32);
     UnmapBuffer(); //ending unmap
     Render(); //Draw whatever else needed

Can anyone tell me where I'm messing up?

gDebugger crash on pause?

16 November 2014 - 11:38 AM

I was wondering if anyone has run into this issue before and has a fix.


I'm trying to use gDebugger 6.2 and I have the latest ATI drivers for my card, but any time I try to use gDebugger on my application and pause it, it auto crashes :(


I get a second chance exception:

Event Properties
Access violation
The thread tried to read from or write to a virtual address to which it does not have access.

Where the last line of the call stack was

RtlInitializeExceptionChain - ntdll.dll

Call Stack
Function Name   
File Path   
Line Number   
Module Name   
Instruction Counter Address   
Function address   

I'm hitting the debug version of my project, also I'm using SDL2 for window creation and GLEW for the extensions



Anyone got any ideas ? That or another openGL debugger tool