• 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.
  • entries
    743
  • comments
    1924
  • views
    578323

Shadows

Sign in to follow this  
Followers 0
Aardvajk

947 views

Decided to celebrate getting the character controller stable by having a big break from physics for a while and get some graphical stuff working. Getting the model and animations integrated was a quick job as I'd written and polished my code for this stuff in the 2D game (animation controller, blending etc) so decided to implement shadows.

game.jpg

[EDIT] Thanks to Ashaman, now have PCF edges to the shadows as well.

game.jpg

I'm staying away from stencil shadows after my last attempt and am just doing standard shadow mapping here, using an orthographic projection for the depth rendering as I want sort of cartoony, always from above shadows for this game. It actually works suprisingly well. I do nine samples in the pixel shader and average the result to get the depth at each pixel. Produces very nice results if the depth texture is 2048 x 2048, and passable if it is 512 x 512.

Had to rewrite a bunch of stuff in the Scene and SceneItem classes to allow for rendering different passes, at the moment just so I can render the depth pass, then the main pass, but this will come in handly later on I expect for other fancy effects. You can also now easily create an object that casts no shadow, just by setting its RenderPass::Depth method to RenderMethod::Null and so on.

Had to abandon shadows being casted onto the player character as looked a right mess. One thing about orthographic, from above shadows is you can't have them cast on vertical walls either as it looks wrong, so I pass the normal of the pixel into the shadow pixel shader, and only shadow it if its dot with 0, 1, 0 is above a certain threshold.

Since journals are always better with images, here is my depth texture for you to enjoy.

texture.jpg

Thanks for reading.

5
Sign in to follow this  
Followers 0


2 Comments


Great work !

 

 

I do nine samples in the pixel shader and average the result to get the depth at each pixel.

Are you fetching 9 depth values, create the avg depth from it and compare it vs the scene depth ? The correct way would be to fetch 9 shadow values (comparision already done, result is 0=out of shadow, 1 = in shadow) and average this result, resulting in some soft shadow edges (PCF).

 

A nice,easy improvement is to start with 4 shadow-fetches and only continue to fetch (eg) 16 more if not all of the original 4 are either completly in shadow or out of shadow.

2

Share this comment


Link to comment

Great work !

 

 

I do nine samples in the pixel shader and average the result to get the depth at each pixel.

Are you fetching 9 depth values, create the avg depth from it and compare it vs the scene depth ? The correct way would be to fetch 9 shadow values (comparision already done, result is 0=out of shadow, 1 = in shadow) and average this result, resulting in some soft shadow edges (PCF).

 

A nice,easy improvement is to start with 4 shadow-fetches and only continue to fetch (eg) 16 more if not all of the original 4 are either completly in shadow or out of shadow.

 

Ah, interesting. Yes, I am doing it the (wrong) way you describe. Thanks for the tip, will have a look at that.

 

[EDIT] Got it, excellent, thanks.

0

Share this comment


Link to comment

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