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

nVidia bug on texture depth?

5 posts in this topic

Hi,
I've noticed a possible bug on nVIdia cards. I'm developing a game that handle 3D textures and when I need to use a layer from that 3D texture, I use a formula like this:
[CODE]z = 1.0f/textureDepth * layer[/CODE]
On my home computer this formula works without problems (I'm using a ATI Radeon 4800 series) and it render the layer that I want, but on nVidia (and also on Intel HD 3000) it doesn't. The bugfix can be resolved editing that formula:
[CODE]z = 1.0f/textureDepth * layer + 0.00001[/CODE]
Someone noticed this before? I can't find anything about it on gamedev and also on Google...

EDIT: This problem happens when the texture depth is an odd number Edited by Retsu90
0

Share this post


Link to post
Share on other sites
Different videocard-chip ventors handle errors differently, so one driver could be more robust to your errors than others, still it is most likely an error. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

What happens when textureDepth or layer is 0 ? In this case you would have 1.0f/0.0f which is invalid. Adding a small epsilon like 0.00001 will work as long as textureDepth * layer gets not negative. Edited by Ashaman73
0

Share this post


Link to post
Share on other sites
Possible floating point precision problem - it's not a bug, just that some (older?) NVIDIA drivers will optimize shader code down to 16 bit FP precision if their compiler thinks it can get away with it.

Try using "layer / textureDepth" instead - it's mathematically equivalent but should preserve precision better. Edited by mhagain
0

Share this post


Link to post
Share on other sites
Hold up.

What you probably intended was:
[CODE]z = 1.0f/textureDepth * (layer+0.5)[/CODE]

Because texture samples should be in the center of the texels. If you're already taking this into account in "layer", nevermind; carry on.
0

Share this post


Link to post
Share on other sites
If textureDepth == 0, you're gonna have baaad time.

BTW, don't you mean?
z = 1.0f/(textureDepth + 0.00001) * layer
(note the parenthesis and change of order)

And also... not enough information. Which GeForce GPU did you try? Are those variables all float or half?
For example GF 8000 series will convert to float, but GF 6 & 7 series will respect the 'half' variable. Halfs overflow much faster than floats, hence you'll get to infinity through the division with surprisingly not-so-close-to-zero values.

Also if you're using Cg; it wrongly allows you to write to just one output (i.e. return float) while PS 3.0 strictly says all pixel shaders must return a float4 value per render target (i.e. which may happen when you write to the depth texture). Not writing to all outputs is undefined and will cause weird results in Intel cards.
Check if DX Debug runtimes have something to say.
0

Share this post


Link to post
Share on other sites
(layer+.5f) / textureDepth resolved the problem! It's a good idea to take the Z in the middle of the texture!
However I'm using a GeForce 620M.
There are no possibilities that textureDepth is 0 due to some checks (textureDepth is a private member in my class) Edited by Retsu90
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