Deferred Shading DirectX demos? - c++

I've been reading a lot about deferred shading and want to try and get into it. Problem is I can't find a sample which demonstrates how deferred shading can support so many lights simultaneously - I found one demo which was very simple with a single light in Code Sampler and an nVidia HDR sample butnothing beyond that.
Would anyone know where I should go for a good introductory tutorial (with code) on how to have deffered shading with lighting? I can make it work with one light but one light is a bit too simple (rather obviously :P). Also I only know how to make directional lights in deferred shading code and it's nice an dall but somewhat different to regular ways of rendering lights so I was wondering if there wree tutorials or anything I could find or just reading material that would help me figure out how writing shaders and special fx in deferred rendering works?
Thanks fo rany help!

NVIDIA stuff is usually good: http://developer.nvidia.com/object/6800_leagues_deferred_shading.html
Here's a reasonable XNA tutorial as well: http://www.ziggyware.com/readarticle.php?article_id=155
In terms of blogs: Wolfgang Engel's is a good start, and Christer Ericson recently posted a bunch of links (in the Graphics section of his "Catching Up Part 2" post).
Oh, and the G-Buffer paper is required reading too. Less practical, but a good review of the process and rationale.

Related

Which GLSL version should i learn first

Hey i've started learning WebGl and soon discovered that the language was a tad too difficult to understand. So i've looked for a GLSL tutorial to first grasp the basics of this language before passing on to WebGL . I found this course online that explains GLSL 1.10 which is not by far the latest version(which i think is GLSL 4). So i wanted to ask if there is any difference between tthis version and the latest and will it matter which one i learn?
GLSL is the Shading language, not the API used for the rendering itself (which is equivalent to OpenGLES2.0 in the case of WebGL). If the goal is to work on WebGL, I would recommend going from OpenGLES2.0 (the WebGL specification itself is written as a delta document over OpenGLES2.0), then GLSL corresponding to WebGL. This would also help understanding the more advanced desktop OpenGL versions.
The WebGL (and the corresponding GLSL) specification is at,
https://www.khronos.org/registry/webgl/specs/1.0/
I will only give you here a personal opinion, based on a personal experience.
You can ( note that I wasn't far from saying "should" ) start by GLSL 1.10, because since then a lot have changed : the developper has to manage on its own things that he hadn't to do before, in terms of transformations for example.
Those things are really important to understand, but if you want to start slowly you may want to avoid them at first. It's a bit like the end of the matrix stack in your OpenGL codes, you have to face it one day, but maybe not the day you begin using OpenGL.

Procedural textures in OpenGL

I'm currently reading the "official" opengl guide book and their explanations and example codes are way too complex for me. I think I got the idea of procedural texturing, but I can't find any fine tutorial about them. Does anyone know a good guide on that subject? Or maybe explain it a little bit?
This book is the best on the subject:
Texturing and Modeling: A Procedural Approach
It is not API specific so you won't find any OpenGL examples but it does go in depth about techniques for procedural texturing.
Another great resource for examples of procedural graphics is this:
Shadertoy
(note that it works best with Google Chrome)
It is a fantastic collection of WebGL fragment shaders (WebGL is based on OpenGL).

how to use glFogCoordEXT in GLSL

I used glFogCoordEXT to distinguish explored and unexplored terrain. But after i use a shader for normal mapping on terrain, its working fine but the fog is no more there.
can some one help me, (i don't know glsl).
I think you used the fixed-function-pipeline before? By using a custom pixel-shader you "overwrite" the fixed-function-pipeline. You have to manually add fog to your pixels inside the normal-mapping-shader, but that is difficult without any knowledge of GLSL. You may try googeling for GLSL fog, there are plenty of fogging-functions for GLSL that work with the built-in variables (which are edited by glFogCoord). You can then try to wire this function into your normal-mapping-shader. Read a tutorial about vertex/pixel shaders before, they are not that hard to understand. Shaders are just mathematics, the language itself is much easier than the C++ code of the actual program.

3D effects description book

I was wondering around google and found nothing good for 3D effects such as bump map, parallax mapping, etc. Please help me with this, is there a book which describes different ways to achieve such effects? furthermore if the book has opengl samples for the algorithms it would be much better.
I've enjoyed Real-Time Rendering. When I wrote my 3D engine everything I needed to know was contained in that book.
http://www.realtimerendering.com/book.html
The GPU Gems series of books comes to mind. Also available online at the NVidia developer webside.

OpenGL: Easiest way to make shadow and light Volumes?

I want to ask what is the easiest way to make shadow and light volume ? How can I bring to scene more realism? Do you know any nice tricks ? I hear that to make shadow i must use stencil buffer, but I don't know how:/ I can't find any super simple example how to make it.
There's no super simple way to do shadows. Sorry to disappoint you but shadows are one of the more complex problems in computer graphics, especially if they have to look good.
Now with that said here are some maybe helpful links for further reading:
The Theory of Stencil Shadow Volumes
Shadow Mapping with Today's OpenGL Hardware
Real-time Shadow Algorithms and Techniques
There's a simple example of shadow mapping in the NVIDIA SDK 9 here (Paper) which might be easy to adopt. There's also a section on shadows in all volumes of GPU Gems and a good overview in the Real-Time Rendering book (without code).
The Wolfire blog has had some good articles on shadows. Nothing too technical, no code samples, but to get a good overview of the concepts, they are great (and I love the pictures that always accompany the articles!).
Here is a full list of every article with "shadow" or "shadows" in the title. You may also choose to do a search on their blog for "shadow|shadows" to see every possible article, but beyond this list you probably won't find too much. Might also want to add "-alpha" so that you don't get any hits from their weekly alpha updates, which wouldn't have any worthwhile content.
2006/05/10: Starting shadows
2006/05/18: More shadows
2008/11/24: High-detail terrain shadows
2008/12/02: Object shadows
2009/03/29: Environment shadows - step 1
2009/04/03: Environment shadows - step 2
2009/04/07: Environment shadows - step 3
2009/04/10: Environment shadows - step 4
2009/11/13: Character shadows
2010/03/17: Two-part shadow maps
2010/04/19: Catching baked shadows
(list gathered 2010/05/19 by a google search for site:blog.wolfire.com intitle:shadow|shadows)
These questions are not easy to answer here, it'll require you some study and understanding of how graphic primitives works. However, there are some good sites over the web you can take a look, like Nehe and GameDev. There are lots of articles and tutorials there, just take some time to search and read them. There is also some rendering engines that you can use that will do a lot of nice things for you, like Ogre3d and Irrlicht but if you cant understand the principles behind them (like shadows, illumination...), I recomend you to try in OpenGL first, learn it, and then use some engine to get the work done for you.
In addition to the other useful sources mentioned here, you should consider getting an introductory text on linear algebra, or Eric Lengyel's excellent Mathematics for 3D Game Programming and Computer Graphics, Second Edition. Computer graphics are made of math, and at some level it gets really hard to implement things out of a cookbook without some understanding of the underlying algebra.