WIP - Realtime Raytrace

Community Forums/Showcase/WIP - Realtime Raytrace

Banshee(Posted 2006) [#1]
I've no idea if there's another name for the method i'm using, but I think of it as ray tracing. Or, to use an even fancier title, realtime light source obsfuscation and partial object shadowing...

The effect is a little slow at the moment, but I can see lots of optimisations yet although this was an idea I had after doing the tree system, and if i'd done the trees another way it would be even quicker so I may well write the whole thing from the start again.

It's not quite quick enough to show an exe yet, but I thought you might appreciate some screenies... :)

These pictures show partial shadows cast by trees onto the armoured personel carrier (also cast by hills but not shown).




The effect works by effecting a secondary texture co-ordinate set which points to a 4x4 gradient image. Rays are cast between the lightsource and the vertice to assertain if the route is obfuscated by either the landscape or an object (including mobile objects) within the world. Each vertice is handled in turn, so the effect is quite slow.

However i've found I can greatly speed up the effect by grouping vertices to a single ray and I'm now toying with the idea of making a ray-grouping editor application in order to improve the quality of the effect and reduce the quantity of groups necessary to achieve a disereable result.


big10p(Posted 2006) [#2]
No offense Banshee, but what am I supposed to be looking at in those screenies? I don't see any shadows.


Banshee(Posted 2006) [#3]
They're being cast onto parts of the armoured personell carrier by trees.

I've not done floor lighting yet, I was just going to do standard decals for that.

I've managed to reduce calculation times to as near instant as i'm ever likely too - now I just want to improve the groupings with an editor.


Paul Murray(Posted 2006) [#4]
I think I see, that last pic, there appears to be a soft shadow on the corner of the tank.

Am I looking at the right thing?


Banshee(Posted 2006) [#5]
Yes, that's being cast by a tree canopy just behind the camera. The top picture shows the left front of the tank in full light and the right front of the tank being shadowed by the tree to the left of the picture.

The system is having some difficulty though because of the way i've done the flora, so i'm going to rewrite the whole terrain system from the ground up and introduce some new landscaping ideas i've had.


Banshee(Posted 2006) [#6]
This shows it a bit clearer, i've entityOrdered a yellow sphere to show where the lightsource is, although it's actually behind the tree. Casting a shadow across the right hand side of the vehicle.




Braincell(Posted 2006) [#7]
So its a bit like per vertex lighting, only using textures?

If so you could just flip the normals of verts that are under shadow, could be faster.