   [SlimDX] FallenTemple Demo (underwater)
  The Video shows my small engine-project :-)The FallenTempleDemo shows all shaders in action and i hope you have fun !!Now implemented underwater rendering.The basic idea was to do this with a posteffect. To create the posteffect we need underwaterfog and caustics to render it to a texture.Posteffect:The fog changes color in Y-Direction, it's green and close to the waterheigt blue. The alpha value changes in ZX-Direction for depth effect.The caustics are a set of small textures, changing by gametime, intensity is depending on the normal values in Y-Direction of the terrain. To get this in one step, create a Texturesurface enable clipplanes to clip the terrain above waterheight, draw the terrain textured with changing caustics and mixed by fogcolor. To get the rest in blue and correct alpha, disable clipplanes and draw the Waterquad with fog.Now the Posteffecttexture is ready.Watermap:To draw the watermap use refraction-settings, but clip the underwater geometry.Scene:If the player ist underwater, draw the terrain, draw the waterquad and apply the Posteffecttexture with alphablending.The Effects in the Demo: - waving vegetation shader - sunshader with occlusion test for Lenseflare - watershader for watersurface and underwater rendering - cloudshader for simple procedural clouds - lightshader for directional light + normal + displaced - terrainshader to texture terrain by height and normal - firstperson - cam with intersection groundtesthave fun:  ">The Fallen Temple[Edited by - mdx on May 28, 2010 9:15:02 AM]
  Looks really great, congrats!   ;  Realy nice! Good job   ;  really really nice!   ;  looks really good...but don't make the mistake of doing what a lot of games did back in the days and beat the lens flare effect to death. I never did get it cause lens flare don't really belong in a first person perspective seeing that we are presenting the scene from the viewer perspective(their eye) and unless we all have cameras for eyes, eyes don't see lens flare effect(just my opinion). Third person, maybe seeing that there is an implicit camera in the scene and cameras do 'see' lens flare. But I digress, again congrats...looks really good.Btw, kinda curious, how are you doing your vegetation rendering?;  so the graphic looks nice, but it's still DX9, old style and very simple techniques, so LensFlare is a must have :-)no, you're right, and it's just one switch to turn it off.Vegetation:the vegetation ist very simple, you can load the center-position's from a file and switch between ,tree's, palm's,grass or plant's and randomize to get a jungle. The geometry is very simple using billboards, crossboards or starboards for grass.So you have just one position for sorting and frustum-test, other vertices are generated by vertexshader, passing the scaling values. That makes sorting fast.Tree's, palm's and plant's switch to billboards if a distancevalue from player has reached.Tree's, Plan't and Palm's are renderd in 2Pass with Z-Buffer and Alphablending without Z-Buffer. Alphatest ist done in shader with clip command.Grass is rendert in one pass, only Z-Test and AlphablendingSo i've 3 VBuffersVB1 = grass (3 quads)VB2 = other plants (2 or 1 quad)VB3 = other plants no waveeffect and 1 quadthe third buffer is rendering the reflected vegetation on the watermap   