• 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.
Sign in to follow this  
Followers 0
JDev

JOGL and Texture mapping

3 posts in this topic

hello everyone, I'm having a problem with my 3D engine that is written in Java and JOGL. I am using the NeHe texture mapping program as an example and I'm loading his sample png image in my current program. I can load the image just fine, but then all I can see in my world is blue, white, and a dark green.....? My world is very simple right now, just a box that I can fly around in and each side of the box is a diffrent color. I'm attaching the image to a glQuad, and that is the only place currently that loads or draws any textures at all. Anybody else have a simular problem with JOGL...? thanks in advance, JDev
0

Share this post


Link to post
Share on other sites
The problem is probably the texture not JOGL. How are you loading the texture? Have you tried a different texture to see if maybe the texture is saved in a format that isn't supported by java?
0

Share this post


Link to post
Share on other sites
Post your setup and drawing code. Do you have texturing enabled? Are you using lighting? Can you see the quad at all? If so what color is it? Does it look textured, even if the terxture is wrong? I assume from your description the blue white and green you see are the sides of the box, or is that on the quad? Maybe post a screenshot if you think it would help.

If you have lighting on, try turning it off until you get textures working. Make sure textures are enabled and you are loading the texture into opengl correctly. If you are enabling any opengl state you don't absolutely need, comment that out. If you don't see the quad at all, check the position of the quad and the modelview matrix, also check the winding of the verts. Try turning off backface culling or swaping the winding order. It's pretty easy to draw geometry backwards or in a place you aren't expecting.

Try generating a simple test texture. Fill an array with a single color or maybe a simple pattern. Then load that as your texture. If you can get that working then the problem is in your png loader.

If you can see the quad but it is the wrong color check your texture coords, make sure you are setting them and they make sense. Also check all your opengl texture state, try using default values.

If the quad is drawn and textured, but the texture is wrong, check your texture loading code. Check your unpack alignment settings. Check the pixel format you are using, make sure it matches your data. Some file formats are bgr instead of rgb, if this is the case with yours you'll need to swap the bytes or if your opengl implementation supports it you can use the bgr format.

0

Share this post


Link to post
Share on other sites
This is going to sound really stupid, but I'm still really new to openGL. I was enabling texture mapping at the begining of my program and didn't disable it when I was drawing things that were not being texture mapped. Everything that was being drawn using the normal glColor3f functions had texture mapping enabled on them, but no points were specified. So basically, everything was being texture mapped with the one pixel at 0,0 of my default texture.
thanks for the reply's guys,
JDev
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0