Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

D3D11 Resource Visualization

D3D11 Resource Visualization

Jason Z
Jason Z
Chronicles of the Hieroglyph · · 2 min read
967 0

D3D11 Resource Visualization

I've been spending some time rethinking how my Lua scripting system is going to look in its second generation. I don't want to totally change the system, but there will be some significant simplification and streamlining of the binding process this time around. I've been reading lots of other people's work on binding systems, and have a good idea of the changes that I want to make.

In the meantime, I have also been working on adding resource visualization to my engine. The idea here is to be able to have a 3D object rendered onto a scene that produces some visualization of a resource that is currently being used. I have always liked the idea of having a 3D user interface, and this concept stems from some of my initial work in that area. I also made sure that the entire visualization system utilizes ONLY existing rendering code, so it fits nicely with my scene graph and material system.

I have started out with visualizations for 2D textures, since these will likely be the simplest case. I made a function that takes a resource pointer (the proxy object I use to identify resources), and a render effect to perform the visualization with, and it returns an Actor that contains a node with two geometric entities attached. The first one is a box like frame that goes around the visualization and utilizes a regular shader. The second geometry is just a rectangle (two triangles actually...) that fits within the frame, and has a material applied that samples the 2D texture resource and then performs some visualization on it. The image below shows my AmbientOcclusionI sample with the visualization object added to the scene to visualize the depth/normal buffer:



Since the contents of a particular 2D texture may be used for radically different purposes, the function must take a render effect to do the visualization. For example, the difference between an exponential shadow map and a variance shadow map are quite huge - and you would use different code to visualize each of them in an effective way. To demonstrate that the 'frame' is part of the 3D scene, I also moved it to intersect with some of the normal geometry in the scene as well:



I have some other concepts planned out for other types of resources too, but those will be coming in the next few days/weeks. I still need to add some additional code in for doing picking and mouse interaction, so there is a little homework to wrap up first. I also need to clean up more of the samples before I push the next source code dump to Codeplex as well...

Discussion

Loading comments...