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

Parallax Occlusion Mapping Question

4 posts in this topic

Hi there,
 
So I'm trying to implement the ATI method of Parallax Occlusion Mapping.  It all makes sense except for one slick part which I cannot understand.  I've drawn a diagram to help myself understand what the variables are.  Here it is:
 
parallax.png
 
The ray coming in diagnally is the view ray.  So we basically do a linear search to find the point at which the boundary supertends the height.  The D3D10 sample has a variable called fParallaxAmount.  I've done some simplifying and canceling out and it turns out:

 

fParallaxAmount = (currBound * deltaHeight + currHeight * stepSize) / (stepSize + deltaHeight)

 

This is all dandy, but I can't just copy and paste it without understanding the theory behind it.  I am tempted to solve a parametric system of equations that assumes the slope of the height map stays the same, but the code above seems to be either similar triangles or Green's Theorem.  I can't figure out what it is.  Does anyone have any insight into what it does?  Note that (as far as I can tell) all values are along the vertical axis.  Let me know if you have any input.

 

Thanks,

Mike

0

Share this post


Link to post
Share on other sites

I remember solving a similar equation back when I was working on POM (check it out here for some background info).  Unfortunately the details escape me, but I seem to recall that the solution was possible with similar triangles.  The key to the diagram (and the derivation) was that I had to draw the two vertical segments (separated by the horizontal size of the step), then create triangles from the top of one segment to the bottom of the other segment.  That will create the intersection point in the middle, which is what you want to find.  It was slightly tricky to figure out (for me at least) but after I solved it I remember thinking that it should have been easier to solve...  I guess most math problems are like that :)

 

Also, I think your currHeight and prevHeight are swapped in the diagram - shouldn't the previous height be higher than the current one?

0

Share this post


Link to post
Share on other sites

Yeah, I'm trying to make sense of it, but I think it's a rough estimate of where the intersection point should be.  The equation gives you a point between currBound and currHeight. I'm going to try it on my own using this shortcut and also by intersecting the ray with a psuedo-slope from the heightmap and see which gives better results.  Obviously, the D3D10 sample works and looks great so I'm hoping I end up with a result similar to it.

 

But yeah, currBound starts at 1.0 and moves toward 0.0.  At the same time, the height sampling moves to the right.  So it looks like if you're moving to the right, prevHeight will be lower than currHeight on a counter-relief extruded surface.  Am I wrong?  Maybe I'm looking at it wrong?

 

Mike

0

Share this post


Link to post
Share on other sites

But yeah, currBound starts at 1.0 and moves toward 0.0. At the same time, the height sampling moves to the right. So it looks like if you're moving to the right, prevHeight will be lower than currHeight on a counter-relief extruded surface. Am I wrong? Maybe I'm looking at it wrong?

If the view ray direction is moving in the direction of the arrow, then each step should take you 'deeper' into the texture, where the height value is decreasing as you progress along the ray.  So in that case, I would expect currHeight to be smaller than prevHeight - which would make it appear lower in your diagram...  That is how I interpret it anyways - if it makes more sense to you to have it another way, then by all means use the way that works!

0

Share this post


Link to post
Share on other sites

Haha, I hear you.  Right now I'm trying to write a custom Maya export for "boxy models" where the corner normals are not shared.  Wish me luck!

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