Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: SDL OpenGL palletised mode

  1. #1

    SDL OpenGL palletised mode

    I'm quite a big fan of 640x480x8 bit graphics and would like to start work on an OpenGL version of my current SDL isometric engine. What I'm wondering is if OpenGl supports this or is there some kind of pallete emulation I would have to use. I've yet to learn how OpenGL works so i'd like to know where I stand on this issue before I make a commitment.
    Isometric game development blog http://isoenginedev.blogspot.com/

  2. #2

    SDL OpenGL palletised mode

    Not sure if any hardware OpenGL implementation ever supported a paletted window. There?¢_~s an extension for paletted textures, but unlike most others it is supported only on older cards.

  3. #3
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    SDL OpenGL palletised mode

    Not sure what you mean by palletised but I found getting OpenGL support into SDL very easy. You can do your image manipulation using SDL calls and bind them to OpenGL surfaces. This way you can do anything that SDL can do and just link it to display when needed.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  4. #4

    SDL OpenGL palletised mode

    You may be able to use palletted textures, but you will restricted to a minimum of 16-bit colour for the display.

  5. #5

    SDL OpenGL palletised mode

    hmm, that's put the mockers on that idea. I wanted 256 color pallette so I could do some pallette swap trickery. Shame that, I guess I'll just have to go with the 16/32bit depth. Cheers for the help guys.
    Isometric game development blog http://isoenginedev.blogspot.com/

  6. #6

    SDL OpenGL palletised mode

    Am I correct when I say you want to use a 256 color pallette so you can use the same sprites but with a different color set?

    If so, do you have any alternative ideas for this problem?

  7. #7

    SDL OpenGL palletised mode

    For custom player colors you could make a true color copy of the paletted image for each needed palett, something like day/night lighting can be done by blending a colored polygon on top. There?¢_Ts no way to emulate more complex palette effects, but hey, I know of no game which actually made good use of them.

  8. #8
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    SDL OpenGL palletised mode

    On my list of 'things I'll do one day' is a method of making units in a game display in multiple colors - the plan is as follows.

    Each image is made up of two layers - the first layer is the layer where everything is the same accross all units - skin, boots etc. The second layer is the coloured/personalised layer - uniform etc. All units use the same first layer, and each faction has a customized second layer.

    The reason to do it in a second layer is to allow ingame changes to colors. If the second layer is created using a gray scale, its easy per pixed to change the image to red/green or turquoise - just by adjusting each pixed.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  9. #9

    SDL OpenGL palletised mode

    With a multipass approach like cairnswm suggested you can just modulate texture color with polygon color, but it can only work with single hue, if you want different hues like some parts red and some parts blue then making true color image versions on load is going to be more reasonable then resorting to many passes.

  10. #10

    SDL OpenGL palletised mode

    Ok,... so when drawing the sprite do you just draw two textures and blend them together or do you create a third texture, say, before the start of the level?
    The second option sounds better/faster, but perhaps I'm missing something?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •