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

Directx Texturing Problem.

7 posts in this topic

I've recently started exploring Directx 11. I'm almost done the introduction so I started making my own*.obj parser and it works beautifully. I accounted for the right-hand coordinate system of 3ds Max. The only problem is the texture.

Although the texture is layed out "almost properly", I can see that some mesh inherits texture colors that belong to the background part of uvw mapping. The model though seems to display the textures perfectly in 3ds Max as oppose to "almost properly" in my Directx program. 

I'd love to post codes but to be honest, I don't know where's the problem. Is it the *.obj parser? Initializer? Shader, or specifically Pixel Shader? I'm hoping the experience user would be able to "triangulate" the problem from the variables I've given (If that is a ridicoulous idea of mine, feel free to ask for the code or ask for a specific part of the code).

uvw mapping: 

[attachment=16768:uvw_01.png]

This is "wrong" output of my DirectX program: (The black part is likely from the black background of uvw map. I tried giving more "clearance" from the background without much hope.)

[attachment=16769:texture_problem_01.png]

While this is the "correct" output from 3ds Max:

[attachment=16770:texture_no_problem_01.png]

0

Share this post


Link to post
Share on other sites

I think the problem is with filtering, maybie MAX is doing point sampling with texture for its viewport display (check settings in options)? Try to render it and see if problem is present?

Try to scale down a bit each UV "island" or (it is hard for me to explain so i will point you to tutorial) go to cgtextures under "Tutorials" section find "Alpha mask background trick" and read it.

Edited by belfegor
1

Share this post


Link to post
Share on other sites

I don't really have to time to apply this right now since it's 3 in the morning. But base on your answer and the cg tutorial given, should I give my UV "island" space between each other? If so, what's the "rule of thumb" between separation of these islands via pixels? 

 

Thanks for the reply so far btw.

0

Share this post


Link to post
Share on other sites

I am not competent man to explain how exactly texture filtering works, but i will try.

When you put your uv seam exactly on "island edge" and set filtering other then "point" the pixel shader will sample adjacent pixels from texture thus grabbing "ocean" (the part that is not island biggrin.png  ) color, so you need scale down uv or paint (at least) 1 pixel out of "island" with color of adjacent pixel that is on "island".

I think you need at least 2 "free" pixels between uv "islands".

 

So you need to "expand" colors from edge at least a pixel. Here is rough painting of mine to visualise what i mean:

directx-texturing-proble.jpg

2

Share this post


Link to post
Share on other sites

the problem may be filtering. as stated above, non-point filtering will sample pixels beyond the edge of your desired UV area in the atlas, thereby blending the background color of the atlas into the edges. the fix is to extend the color of the desired texture as shown in the image in the previous post, or reduce the size of the UV area mapped to be safely inside the border of the texture in the atlas.

 

however, if you look at your output, the dark areas don't seem to correspond to where the edges of the textures in the atlas would be, so it may be a UV problem instead or as well. usually with filtering issues, everything looks correct, but you get dark edges where the background is too close to the sampled area. sort of like seams between the textures, but the textures all are in the correct position.

 

note also that mipmaps, alpha blending, and non-clamp addressing can also lead to this "dark areas" problem, its all the same sort of filtering issue.

1

Share this post


Link to post
Share on other sites

Hi,

 

I've done some work with texture atlas's and got similar problems. Check that your sampler is set to UV Clamp (I think this might only be an XNA restriction) and that your texture has deep enough borders to allow linear filtering to work OK at the margins. I can only guess that MAX using some kind of software renderer and does not internally use the texture atlas at all - perhaps it conditions the atlas into separate textures and renders the mesh in sections rather than all at once ?

 

Phillip

0

Share this post


Link to post
Share on other sites

Being my first post, I'm impress with response of this community. After hours of debugging, I've finally figured out how to texture my models perfectly. Your replies helped me a lot in solving the texturing problem. But after applying your recommendations, it turned out that there's more problem. Since I load the model via .obj parser I recently created, I knew right away that the problem is in there. After recognizing the problem, I fixed the problem and now the model renders nicely.

 

With all problems of the day being solved, a new problem arise concerning my .obj loader, since it whent from Big O(n) to Big O(n^2), making it very slow in loading. I will try to implement a hash table tommorow so it will hopefully be down to Big O(nlog(n)), but that's another discussion.

 

Again, I appreciate all your helped, and impressed by this community. 

 

Thank You.

Edited by JoeyAndres
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