• 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
G-Man9566

UV Mapping Algorithms

5 posts in this topic

Hi,

Is there anyone who can guide me in the right direction (or article [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] ). I want to generate UV mapping coordinates for my objects in code. So I would like to generate Plane, Box, Sphere, Cylinder etc. mapping for my objects in code. I am pretty sure there would be standartd algorithms out there to do this. I implemented my own algorithm for box mapping, but I am getting bad results on "edges" (where one vertex is projecting to one face of the box and the other vertex to the other face).

I included two images, one with the my generated mapping ("Incorrect Mapping.PNG") and one which it should look like and was generated by 3dsMax ("Correct Mapping.PNG").

Thanx in advance.
0

Share this post


Link to post
Share on other sites
The second mapping has horrible seams, the texture doesn't match the UV coordinates.
Whatever UV coordinates you generate, you simply cannot expect to use the same generic texture for a sphere and a teapot.
-2

Share this post


Link to post
Share on other sites
Max, better most modeling tools, allow to assign more than one uv-coord to a single vertex. In this case, you need to split your vertex and assign the different uv to unique vertices. That is the reason, you see no artifacts beside the expected seams when using max (the border vertices got more then one uv-coord), but got warping artifacts when using shared vertices in your mapping code.
0

Share this post


Link to post
Share on other sites
[quote name='Ashaman73' timestamp='1328271938' post='4909128']
Max, better most modeling tools, allow to assign more than one uv-coord to a single vertex. In this case, you need to split your vertex and assign the different uv to unique vertices. That is the reason, you see no artifacts beside the expected seams when using max (the border vertices got more then one uv-coord), but got warping artifacts when using shared vertices in your mapping code.
[/quote]

No but when I use the UV's that were exported WITH Max, I get the same result as in Max (the desired result) on excactly the same mesh. So it is litteraly JUST the UV coordinates ons those edges that differ.
0

Share this post


Link to post
Share on other sites
Have you tried scholar.google.com? Most of the time that I'm looking for a very mathy solution I can find something on there... I suspect that the solution will be found in topology papers, but you'll have to take a look around.
0

Share this post


Link to post
Share on other sites
[quote name='G-Man9566' timestamp='1328276159' post='4909150']
[quote name='Ashaman73' timestamp='1328271938' post='4909128']
Max, better most modeling tools, allow to assign more than one uv-coord to a single vertex. In this case, you need to split your vertex and assign the different uv to unique vertices. That is the reason, you see no artifacts beside the expected seams when using max (the border vertices got more then one uv-coord), but got warping artifacts when using shared vertices in your mapping code.
[/quote]

No but when I use the UV's that were exported WITH Max, I get the same result as in Max (the desired result) on excactly the same mesh. So it is litteraly JUST the UV coordinates ons those edges that differ.
[/quote]

What ashaman was saying, is that in 3DSMax the vertices on the corners become unwelded, in order to have seperate UV coordinates. You will find that along those seams on the 3DSMax exported version of the file, there are infact at least 2 vertices for each of those points on the sphere, both have the same position & normal, but will have differing UV/Tangent/Binormal values.

Most UV unwrapping algorithms operate on each face as a unique surface, then re-weld vertices that are within tolerance (or the inverse, and break vertices whos tolerance from connected vertices diverges too much)
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