PDA

View Full Version : Glow and Projective Lighting demo`s



Luuk van Venrooij
09-06-2008, 11:56 PM
For the campagny I currently work for I implemented a DirectX version of there OGL renderer over the past few months. Now I`m shifting my focus for some new cool effects to add to it. Since the engine must have low system requirements we currently don`t use any form of shaders. Just the fixed function pipeline and basic lighting and material functions. I have been doing some research on some new effects which only use the OGL 1.1 specifications.

THe first one is a glow effect using glow textures. First seen in tron 2.0 the first pass renderes the scene with only the parts of the mesh you want to see glowing. This is copied to a texture and then scaled down a number of times. These are then added adaptively the produce a sort of glow effect. By ajusting the alpha you can even make them flicker etc.

Screen:
http://img396.imageshack.us/img396/8373/34664384vz1.th.jpg (http://img396.imageshack.us/my.php?image=34664384vz1.jpg)

The second is a sort of projective lighting. I got the idear for this effect from a video of unreal engine 3 except I use a "lightmap" and they use shadowmapping. The results are pretty similar except I only use OGL 1.1 The first pass renders the scene normal with diffuse ligthing. The second pass blends a projected texture into the scene:

Unreal video at 1 min 20 sec:
http://www.youtube.com/watch?v=Plnh28ykavQ

Screen:
http://img396.imageshack.us/img396/75/96964489no1.th.jpg (http://img396.imageshack.us/my.php?image=96964489no1.jpg)

Both demo`s are in this zipfile here of course with delphi source :D:
http://www.genesisdevice.net/downloads/demos.zip

Controls are the mouse and WASD and F1 and F2 for debug stuff.

Note that both these where coded in less than a day and probebly could be optimised a bit. Also the normal calculations for the projective lightdemo can take a minute.

Over the next few weeks ill probebly post some more research.

Andreaz
10-06-2008, 05:55 AM
You got a "standard" internationalizing error: 122.122 is not a valid floating point number.

I'm using a swedish version of winxp and we're using , as decima seperator, its a real pain.

Luuk van Venrooij
10-06-2008, 07:51 PM
I fixed the Projective texture demo error. Just donwload the package again:)

Traveler
10-06-2008, 09:49 PM
That's really quite nice! I'm look forward to any other demos :)

Bumped to news

czar
10-06-2008, 11:44 PM
The proijective demo just locked (well made it very very very slow) up my system at work. :(

Luuk van Venrooij
11-06-2008, 08:07 AM
@Traveler
Thanx for bumping up to news item :D .


@czar
The testscene is about 40000 polys which is rendered 4 times. When I tested it at work on an inter intergrated graphics card I had the same problem. I used a scene with 15000 polys and it ran with 20to 30 fps. You can get the scene here:

www.genesisdevice.net/downloads/temple.dxs

Just replace the old one in the scene dir.

technomage
11-06-2008, 11:09 AM
Hi Luuk

nice work. I tested them both under wine on my ubuntu box. both worked fine no problems :) Got about 600 FPS on my Nv 7800 GT. :)

Dean

Luuk van Venrooij
12-06-2008, 09:02 AM
I have been working on a new demo last night. I got the idear from half life 2: episode 2. In this they have a flashlight which also casts shadows. Can be seen in action here with some info:

http://en.wikipedia.org/wiki/Source_engine#Dynamic_lighting_and_shadowing_2

I decided to give this a shot without any shaders and here are the first results:

http://img77.imageshack.us/img77/4314/76583616qa7.th.jpg (http://img77.imageshack.us/my.php?image=76583616qa7.jpg)

It uses 3 texture units. 1 for the mesh textures, 1 for the flashlight projection and of course 1 for the shadowmap. Runs with about 25 fps on an intel intergrated graphicscard. Again this is only using OGL 1.2 specifications:).

Still needs some tweaking and I`ll be posting the demo somewhere this weekend.

Luuk van Venrooij
12-06-2008, 06:02 PM
I have improved it quite a bit. I added an extra renderpass and now the shadows get the value of the ambient. The lights are still done by the OGL fixed function lights. It still runs on OGL 1.2 but I also added support for FBO`s so I can use textures largen then the viewport. Here are 2 more screens:

http://img114.imageshack.us/img114/5027/87879956fq8.th.jpg (http://img114.imageshack.us/my.php?image=87879956fq8.jpg)
http://img92.imageshack.us/img92/4339/17630319xt8.th.jpg (http://img92.imageshack.us/my.php?image=17630319xt8.jpg)

I`m also thinkin of adding a shaderpath with some pcf filtering since this could be valuable for the Genesis Device to:).

Next up is cubemap shadows for pointlight and shadows for directional ligting.

Robert Kosek
12-06-2008, 06:07 PM
Luuk, you never cease to impress. That looks really nice. Good job! :)

Luuk van Venrooij
12-06-2008, 11:40 PM
I have succesfully implementated the extra shader path with PCF filter. Here are 2 screenshots 2 compare. First with and then without. The shadows are much smoother now :D.

PCF:
http://img158.imageshack.us/img158/9336/82460564pj8.th.jpg (http://img158.imageshack.us/my.php?image=82460564pj8.jpg)

NO PCF:
http://img259.imageshack.us/img259/2163/67567491pg1.th.jpg (http://img259.imageshack.us/my.php?image=67567491pg1.jpg)

Luuk van Venrooij
15-06-2008, 10:54 AM
Ok here is the flashlight demo as promised:). In the ini you can set a number of things like shadowmap resolution, use of FBO`s and some other stuff. Also during rendering you can apply the PCF shadowmap filter by pressing F1. This really improves the quality and makes low res shadowmaps still look pretty good :D.

http://www.genesisdevice.net/downloads/flashlight.zip

Currently I`m working on some methods to do shadowmapping with pointlights and directional lights. For pointlights I have 2 approaches. For pointlights I`m looking at parabolic shadowmaps and cubemaps. For directional light I`m looking into trapazoid shadowmapping.

Expecting to release some new stuff somewhere next week :D

arthurprs
15-06-2008, 02:06 PM
hi luuk, how is the progress of genesis? this stuff will be included :twisted: ?