• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Ertai

What to use ?

9 posts in this topic

OpenGL provides a number of memory menagement / drawing functions ... but what to use for what kind of stuff ? I''m doing a 2D tile engine, for the tiles i will be using textured Quads, i decided that ... but what should i use to display fonts ? or large pics like a background for the console, or user interface, or menu ... Oh, and what will happen if i try to call glTexImage2D when there is no more VideoMemory available, will OpenGL start using normal mem automatically ? Last question: I''d like to specify the placement of the textures quads so that no stratching has to be done: like every pixel in the texture image will exactly match a pixel in the framebuffer, so i can get more speed by disabling texturefilters, without losing graphics quality ... And what would be the best way to aply lightning to my tiles, by using vertex colors and smooth shading, but i can''t really get a grip on the glTexEnvi Function ... and the last question: I normally just set my viewport to the dimentions of my window, but when i do so a quad (-0.5, -0.5, 0.5, 0.5 ) will come out as a rectangle it would be a great help to just have gl coordinates match screen pixel coordinates ... thx in advance for any help !
0

Share this post


Link to post
Share on other sites
quote:
Original post by Ertai
OpenGL provides a number of memory menagement / drawing functions ... but what to use for what kind of stuff ?

I''m doing a 2D tile engine, for the tiles i will be using textured Quads, i decided that ...

but what should i use to display fonts ? or large pics like a background for the console, or user interface, or menu ...



Just use textured tris or quads.

quote:

Oh, and what will happen if i try to call glTexImage2D when there is no more VideoMemory available, will OpenGL start using normal mem automatically ?



Texture management is black box. Just load them and let the driver do its job. It works for most cases.

quote:

Last question: I''d like to specify the placement of the textures quads so that no stratching has to be done: like every pixel in the texture image will exactly match a pixel in the framebuffer, so i can get more speed by disabling texturefilters, without losing graphics quality ...

And what would be the best way to aply lightning to my tiles, by using vertex colors and smooth shading, but i can''t really get a grip on the glTexEnvi Function ...

and the last question: I normally just set my viewport to the dimentions of my window, but when i do so a quad (-0.5, -0.5, 0.5, 0.5 ) will come out as a rectangle

it would be a great help to just have gl coordinates match screen pixel coordinates ...

thx in advance for any help !


Try fiddling with the glOrtho parameters.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato
0

Share this post


Link to post
Share on other sites
Nope but you can have a bunch of 256*256 Textures to do the job, the only problem is that you have to draw more polys and other stuff, not a hard problem to deal with.

Also the max texture size depends on you Video Card, the most common is 256*256, also textures height or width should be Powers of 2:

2
4
8
16
32
64
128
256
512

Well i hope that Helps at least a Bit


Behold the Powers of 2!
W-Buffer
0

Share this post


Link to post
Share on other sites
I allready knew that, but thank you anyway, I just thought it would be possible because i read something about going around that limitation in one of the NeHe tutz ..

but wouldn''t it be better to just use a glDrawPixels command for drawing such a large picture in 2D .. and only use textured Quads for smaller pics ?

and one other thing, you guys where talking about using glOrtho for aligning screen coordinates with opengl coordinates, could you tell me a little bit more about that ?
0

Share this post


Link to post
Share on other sites
quote:
Original post by Ertai
I allready knew that, but thank you anyway, I just thought it would be possible because i read something about going around that limitation in one of the NeHe tutz ..



Technically it is still a power of 2 texture, you just use part of it for you nonpower of 2 texture.

quote:

but wouldn''t it be better to just use a glDrawPixels command for drawing such a large picture in 2D .. and only use textured Quads for smaller pics ?



glDrawPixels is slow. OpenGL is a 3D graphics api, using glDrawPixels bypasses all the hardware acceleration available on your videocard.

quote:

and one other thing, you guys where talking about using glOrtho for aligning screen coordinates with opengl coordinates, could you tell me a little bit more about that ?


When your screen is set to 800x600 it is not square. I bet you are setting glOrtho to a square. -5, 5, -5, 5, -1, 1. That means OpenGL is trying to fit a square onto a rectangle and you get your square polys stretched into rectangles. Just make sure you parallel viewing volume matches the aspect ration of your screen resolution. 800x600 == 4/3 -2, 2, -1.5, 1.5, -1, 1

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato
0

Share this post


Link to post
Share on other sites
Thank you! you are the best, an answer to all my questions !

There is still one thing i don''t get:

If i have tile of 64 * 64 pixels ( for example )
how do i make sure that when I render one, using a textured QUAD, every texel stored in the textures will be placed on one pixel in the framebuffer exactly, so my texture doesn''t become ugly when i disable all those beautifull texture filters ...

thx in advance, Ertai
0

Share this post


Link to post
Share on other sites
Hey !, i btw got my math teacher to tell me everything about matrices, so i might be able to figure that one out myself, but that is still to happen, and I would still very much like to see your reply !
0

Share this post


Link to post
Share on other sites
hmmm, so i called

glOrtho( 0.0f, SCREEN_X, SCREEN_Y, 0.0f, -1.0f, 1.0f );

on the Projection matrix, but it doesn''t seem to have any effect whatsoever ...
0

Share this post


Link to post
Share on other sites
If you can post the code here or send it to me it would be easier to fix your problem. I can''t believe that glOrtho has no effect. I use it to get exact screen coordinates with an editor I made.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato
0

Share this post


Link to post
Share on other sites