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

Buffer<uint> reading wrong values

5 posts in this topic

I'm currently trying to get a basic Forward+ renderer working. I've managed to get the first two steps which is the z-prepass, and the lighting stage working. In the lighting stage i have an RWBuffer<uint> that has the format of R8_UINT that stores the tile light indices. That R8_UINT buffer is then passed on to the forward shading stage as an Buffer<uint>. My problem is that when it reads the value of the Buffer<uint>, it always returns 0 even if the buffer contains a different value.

 

I have verified that i am binding the buffer correctly and its value after the lighting stage(compute shader) through the VS Graphics Debugger. Currently, i'm setting my scene so that there are no lights and the light indices buffer are all filled with the max lights value of 256. When it gets to my forward shader though, when it reads the light indices buffer it is always 0. I have checked the buffer bound to my light indices buffer and the xbyte values are all 0xff which should give me 255(uint) but all i get when i read the buffer are all 0. Do i need to do something with the buffer after the compute shader but just before it gets to my forward shader?

 

My implementation is an adoption from MJP's IndexedDeferred demo.

1

Share this post


Link to post
Share on other sites

It sounds like you're doing everything correctly, so I'm not sure what the problem is. You shouldn't need to do anything to the buffer after the compute shader is done writing to it, you should be able to just read from it in your pixel shader assuming that the UAV and SRV were set up correctly. If you didn't set up the UAV or SRV correctly the debug layer will usually output a warning to let you know that you did something wrong, assuming that you enabled the debug layer when creating the device.

2

Share this post


Link to post
Share on other sites

sigh... it would have saved me a lot of time if I simply looked at my output window. It turned out i wasn't clearing the bound UAV so when i render the geometry, DX was forcing the SRV to null. Thanks for your amazing help to the community, MJP!

 

Also if you don't mind me asking, i just pretty much copy-pasted the entire lighting equation and i simply don't have any idea on how do some parts of these equation work. I'm guessing that this is a part of the Physically Based BRDFs thing? I've been meaning to learn more about Physically Based Rendering but most of the resources ive seen seem to assume that you already have prior knowledge about these stuff already which just confuses me more. I was wondering if you could provide maybe some articles or a book i could read that talks more in-depth about these topics?

1

Share this post


Link to post
Share on other sites

Also, prior to the new lighting equation, the phong lighting model was a lot brighter. Now it looks very dark! lol

Edited by BrentChua
1

Share this post


Link to post
Share on other sites

Yeah the debug layer output can be a lifesaver sometimes! If you want, you can actually set it up to break into the debugger when a warning or error occurs. I usually do this so that I know right away that something is wrong, and also so that I know exactly where it's coming from.  It's really easy to do:

 

ID3D11InfoQueue* infoQueue = NULL;
device->QueryInterface(__uuidof(ID3D11InfoQueue), reinterpret_cast<void**>(&infoQueue));
infoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_WARNING, TRUE);
infoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_ERROR, TRUE);
infoQueue->Release();

 

As for the BRDF, it's basically an energy-conserving Blinn-Phong BRDF paired with a Fresnel term. The energy-conserving Blinn-Phong model does indeed come from the "Physically Based Shading"  side of things. If you're not familiar with the basics, I'd recommend reading through Real-Time Rendering 3rd Edition. It's a fantastic book all-around, but it has a great chapter that describe the physics of lighting and reflectance, as well another chapter that gives a comprehensive overview of BRDF's and the basics of physically based shading models. I'd also recommend reading through Naty Hoffman's presentations and course notes from SIGGRAPH. The slides from this year's course can be found here, but his course notes aren't up yet. You can also find last year's material here.

1

Share this post


Link to post
Share on other sites

That would definitely help me a lot; I'll include it in my code. I actually have the Real-Time Rendering Book. I've only read the first few chapters before i laid it off because of work and just totally forgot to get back reading into it. Thanks again for all your help. I really appreciate it.

1

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