I have a new PC computer and this is a milestone for the development for BGE and my racing game. Finally I can to some more quality screen capture, and the first ones to show you are - area lights!
As soon as I saw Arkano22`s implementation of area lights in gamedev.net forums I knew Blender must have it in GE! This is a slightly modified version of Arkano22 technique, the biggest differences are the smoother light falloff and specular reflection glossiness variations based of the reflecting surface properties and distance, and of course - the texture support!
video showing how to set-up them:
win32 build: https://dl.dropbox.com/u/11542084/Blender246AreaBuild.zip
Awesome work!
ReplyDeleteVery neat
ReplyDeleteDo you know what you just did with those reflections?
ReplyDeleteYou made it possible to remake your BPCEM scene with arealights. Each arealight having the texture of its corresponding wall.
Is it possible to give the arealight a instant falloff, so that it produces the reflection but no light? Could be useful to fake reflections only, otherwise it will be interesting to see what GI effects you can produce with this.
I am gonna do some serious tests with this!!! :D
I made small example. http://www.pasteall.org/blend/17534
ReplyDeleteI had some problems making the arealights the same size as the meshes, the metric system seems to be buggy. I made the meshes 8x4m, but the arealights 8,4m are much smaller... don't know what the problem is at the moment.
When you untick the Diffuse tickbox and only use Specular (in the arealight "Lamp" settings); there is no falloff to the reflection.
ReplyDeleteCould you fix that, so that the reflection is the same using Diffuse or not?
I did not apply the scale, that's why the measurements did not match.
ReplyDeleteI made a better blend file here:
ReplyDeletehttp://blenderartists.org/forum/showthread.php?209688-Box-Projected-Cube-Environment-Mapping-demo-%28Shiny!%29&p=2243142&viewfull=1#post2243142
hey, thats pretty neat, hehe. about the specular falloff - youre right, I have to check that.
DeleteLove it. But can you please tell me what music I'm listening to ?
ReplyDeleteIt is a soundtrack from Half-life 2 mod "Neotokyo". You can listen and download it in soundcloud.com
DeleteI found another use for it ;)
ReplyDeletehttp://blenderartists.org/forum/showthread.php?245954-preethams-sky-impementation-HDR&p=2244203&viewfull=1#post2244203
This comment has been removed by the author.
ReplyDeleteHey, how did you do the textures? do you have to blur them in preprocess to use as a light source? I'm curious because you get sharp reflections but soft glow aura...
ReplyDeleteYou mean the texture blurring? I am just changing the mip-mapping offset based on the distance of the surface. Basically something like:
Deletemiplevel = distance*glossiness;
texture = texture2DLod(sampler,coords,miplevel);
Actually I can just give the whole code :) I will host it somewhere, hold on.
Deletehere you go: https://dl.dropbox.com/u/11542084/AreaLights.txt
Deletethis is the whole blender implementation on the shader side.
you have to run this for each area light in the scene something like this:
for (i=0; i<AREALIGHTS; ++i)
{
diffuse += areaDiff();
spec += areaSpec();
#ifdef TEXTURE
diffuse *= areaDiffTexture();
spec *= areaSpecTexture();
#endif
}
Heh, nice trick with the mipmaps! And thanks for the code. You can see some of the results here http://www.flickr.com/photos/marcinignac/8210047821/in/set-72157629801608107 i'll play with textures later.
Deletenice results!
DeleteI went through all of your work - awesome stuff!
hey i stumbled upon a version of realtime spherical area lights. do you plan to also implement this type of light into blender?
ReplyDelete