• 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
thecheeselover

Shared vertices or not for primitives

8 posts in this topic

Hello,

 

I was about to create a some classes to create primitives in order to help me with debugging. However, I don't know if each primitive should share its vertices. For example, a cube should not share its vertices because the normals would be inadequate for lighting and the uv coordinates wouldn't fit for a cubemap. However, for a sphere the normals would be better with shared vertices but what about the uv's? Would it work or should I not share the vertices for a sphere and instead calculate the normals as if they were shared?

 

Thank you! :)

0

Share this post


Link to post
Share on other sites

I don't see any problem with using texture coordinates the way you described, although it greatly depends on how you do the mapping of your texture coordinates.

When using a spheremap you could assign textcoord for each vertex just like you described, no need for dublicating any vertices.

If you go ahead an try to project a rectangular texture (or other more fancy things) onto the sphere, you have to dublicate the "top" and "bootom" of the sphere, where you have that triangle fan like structure.

Hope that answers your question.

1

Share this post


Link to post
Share on other sites


If you go ahead an try to project a rectangular texture (or other more fancy things) onto the sphere, you have to dublicate the "top" and "bootom" of the sphere, where you have that triangle fan like structure.

 

What about the sides? If one vertex reaches the end of the texture on the X axis how will it go back to the beginning?

0

Share this post


Link to post
Share on other sites

Texture coordinates, normals, etc., are all part of the vertex information.

When 2 vertices (including all of this data) are exactly the same they should be shared.  It is that simple.

The same vertex should never appear twice in a vertex buffer.

 

If 2 vertices have the same position but different normals, then by definition they are not the same vertex and cannot be shared.

 

 

L. Spiro

Edited by L. Spiro
1

Share this post


Link to post
Share on other sites

What are these debug shapes used for? Do they even need uv's?

Yes they need uv's because I'm learning GLSL and testing shaders.

 

And I'm still confused. I have a rectangular map that I want to apply to a sphere. How could the vertices that are at the beginning and the end of the texture in uv coordinates work normally, and by working normally I mean making a beautiful sphere. If a vertex at (0.9,0) (in uv's) makes a triangle with a random vertex and the one with (0,0) the texels applied to the triangle will cover the whole texture on the X axis instead of making a continuous texture mapping, i.e. (-0.1,0) to (0,0).

Edited by thecheeselover
0

Share this post


Link to post
Share on other sites

by working normally I mean making a beautiful sphere

When applying a rectangular texture to a sphere you always will suffer certain deformation of the image you are texturing. 

 

I don't know the exact representation of your sphere but I will just guess, that it consists of "stacks and slices" (Like starting with one vertex at the bottom and then creating concentric circles around an axis with first growing and then shrinking radii).

So lets just look at the body of the sphere (excluding the start and end points) the only thing you have to take care of here are the vertices located at the fissure points (the points where the UVs (0, t) and (1, t) meet). Since they have the same position and normal but different UVs you have to save 2 vertices here (like L. Spiro described). Note that the image will be interpolated to fit the sphere (just like the opposite, that is happening when you try to draw a world map onto a rectangular area the image is stretched).

For the top and bottom vertices you might want to save them multiple times so that each face can address its own vertex (you would then have number of slices times vertices with the same position and normal but different UVs for the top or the bottom vertice).

 

If its for learning just test around and you'll find your way.

Maybe try to texture an image that looks like this one: http://www.mediavr.com/belmorepark1left.jpg there the textured image would look a little nicer, because the image itself is streched beforehand.

 

hopefully i am not further confusing you.

1

Share this post


Link to post
Share on other sites

a vertex is a redundant vertex only if its entire attributes are equal to other one.... as normals, texture coordinates, colors, or weights, you name it, only if a vertex is enterily redundant, it can get reindexed. Else how you have to establish the unique vertex

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