Game Development Community

Radiosity effects

by Desmond Fletcher · in Torque Game Engine · 05/11/2005 (11:19 am) · 32 replies

John,
How feasible would it be to "attach" a static light to a surface to simulate the glow effect of texture flagged as a light source?
Page «Previous 1 2
#1
05/11/2005 (2:42 pm)
Hmm, that's an interesting idea. You could setup interiorInstance to register SGPointLights (using the LightInfo struct) at the center of each 'illuminating' surface.

The lighting will definitely look like it's from a point light instead of an 'illuminating' surface (which is bad), but if the surfaces are heavily tessellated and the light radius is large enough it might look ok.

My biggest concern is over relight time. If you add a lot of illuminated surfaces to your interiors, and then add multiples of those interiors to the scene, the light count is going to skyrocket.

-John
#2
05/11/2005 (5:40 pm)
The RAD resource causes the texture (specified in the TGERad_materials.txt file) to be self-illuminated in addition to impacting the lightmap. It may be slow compiling but definately nice on the eyes. My purpose for this is to create the illusion that a window (for example) is backlit (the place is occupied). I tried adding lights in front and it just doesn't have the same glow and effect.
#3
05/11/2005 (7:44 pm)
Ok, I misunderstood you the first time this is actually easier and should work fine. But just to make sure I'm getting it right this time you just want to be able to add self-illuminating surfaces to interiors, right?
#4
05/11/2005 (9:27 pm)
Right on the money! I could then place static lights at or near those surfaces to cast the light and control the light quality with your filters, etc. But if the surface doesn't have a glow effect it won't look very realistic.

Some examples I have in mind:
1. florescent lights
2. fake windows that appear to be lit from the other side
3. signs at night
4. neon effects
#5
05/12/2005 (5:32 am)
I think this would be very useful I'll look into it and let you know what I find.
#6
05/12/2005 (6:24 am)
Muchos gracias :)
#7
05/12/2005 (6:46 am)
Hmm, found this while browsing Gamasutra... applies to DX but tought it could help

http://www.gamasutra.com/features/20040526/james_03.shtml

(need a gamasutra login)
#8
05/12/2005 (9:21 am)
Thanks Jorgen, but I don't have an account.


That ended up being a lot easier than I though (map2dif that is :). The new code adds a member named "self_illumination_color" to the sgLightingScale entity (which is applied to individual brushes), and the self-illumination is applied while the dif is compiled. Here's a snapshot:

www.synapsegaming.com/content/linkedimages/LightingPack_1_4g.jpg
The first block is a standard brush, the second is using heavy self-illumination, and the third is using a toned down self-illumination. Unlike the stock TGE DTS self-illumination which is on or off, this interior self-illumination can be tuned to the color and intensity that you want. Also the surfaces will still receive lighting from other lights, so even when a surface's self-illumination is very low it will continue to blend well into the environment.

Few more shots for comparison:

www.synapsegaming.com/content/linkedimages/LightingPack_1_4j.jpgwww.synapsegaming.com/content/linkedimages/LightingPack_1_4g.jpgwww.synapsegaming.com/content/linkedimages/LightingPack_1_4i.jpgwww.synapsegaming.com/content/linkedimages/LightingPack_1_4h.jpg

I'll see about posting an update, but this may need to wait a week or two until the final release is out.

-John
#9
05/12/2005 (9:41 am)
WOWOW! Exactly what I was looking for. Fantastic. Your solution also implies the sgLightingScale entity could act as the controller for a lot of other effects as well (i.e. scrolling textures, etc.) Absolutely fantastic. Can you send me the patch to test? :) :)
#10
05/12/2005 (2:27 pm)
I just sent you the update, can you post a few pics showing your progress? I'm curious to the effect in action (other than my programmer art :).

-John
#11
05/12/2005 (3:30 pm)
Absolutely--!!!! Thanks
#12
05/12/2005 (11:30 pm)
Again thanks John, the self-illuminating textures work great! A LOT more control over individual textures. Here are a few pics of the current project; these also include the talented modeling of Matt Jones.

holodeck.st.usm.edu/vrgallery/
#13
05/13/2005 (6:15 am)
Wow awesome work Desmond, that's amazing! You should really post a devshot that's the quality and quantity of work everyone is striving for, but few seem to reach. It's also refreshing to see scenes other than dark FPS sci-fi levels (not that there is anything wrong with FPS levels just a lot of them :). The second and forth shots are definitely my favorite.

Btw: I didn't know that you run the holodeck site that's a great site, which helped me out a ton when I first jumped into using Torque.

-John
#14
05/13/2005 (7:42 am)
Wow, great stuff going on here. Nice job guys!
#15
05/13/2005 (9:07 am)
Thanks. but its only cause of great new tools like the lighting pack that we can take this to new levels.

The holodeck site needs some major updates...some of the tuts are based on older TGE versions. Some are based on great resource additions so they may not apply to all. In any case, I plan to upgrade the lighting as I figure out all the potentials of your LP. It will definately be worthwhile to put out a doc that illustrates the differences between stock, rad, and LP lighting. And I also have versions of map2dif combined with trans interiors and translucentDetails.

I'm having trouble with the spotLight dataBlock...no light. Not sure if I am implementing it correctly. I want to use them to uplight Matt's trees (lights in the planters from below shining up). But I'm like a kid in the candystore...

One other note: the shared edge problem seems to have disappeared...don't know why because I checked out a variety of map2dif versions. But I'm breathing better now LOL
#16
05/13/2005 (9:49 am)
Can you post the datablock settings?

The only restriction on spotlights is that they must be static, however when a spotlight is set as dynamic it defaults to an omni light, so you should be seeing something.


Thanks Adam!
#17
05/13/2005 (1:02 pm)
I added three more screencaps to the link above showing the sgSpotLightDatablock and the script is below. However, I discovered that the spot IS working (check the seventh image)...just not on the leaves of the tree model--just the trunk (will have to check with Matt on that I guess)...or, hey, I can change the luminosity of the DTS, hmmm. John, you've created a monster---so many possibilities. LOL, artists with options can be dangerous :)

datablock sgUniversalStaticLightData(sgSpotDataBlock) {
   className = "sgUniversalStaticLightData";
   LightOn = "1";
   Radius = "8";
   Brightness = "0.62069";
   Colour = "1.000000 1.000000 1.000000 1.000000";
   FlareOn = "1";
   FlareTP = "1";
   FlareBitmap = "~/lighting/corona";
   FlareColour = "1.000000 1.000000 1.000000 1.000000";
   ConstantSizeOn = "0";
   ConstantSize = "0.4";
   NearSize = "0.4";
   FarSize = "0.6";
   NearDistance = "3";
   FarDistance = "10";
   FadeTime = "0.1";
   BlendMode = "0";
   AnimColour = "0";
   AnimBrightness = "0";
   AnimRadius = "0";
   AnimOffsets = "0";
   AnimRotation = "0";
   LinkFlare = "1";
   LinkFlareSize = "0";
   MinColour = "0.000000 0.000000 0.000000 1.000000";
   MaxColour = "1.000000 1.000000 1.000000 1.000000";
   MinBrightness = "0";
   MaxBrightness = "0.62069";
   MinRadius = "0.1";
   MaxRadius = "4";
   StartOffset = "-5 0 0";
   EndOffset = "5 0 0";
   MinRotation = "0";
   MaxRotation = "359";
   SingleColourKeys = "1";
   RedKeys = "AZA";
   GreenKeys = "AZA";
   BlueKeys = "AZA";
   BrightnessKeys = "AZA";
   RadiusKeys = "AZA";
   OffsetKeys = "AZA";
   RotationKeys = "AZA";
   ColourTime = "5";
   BrightnessTime = "5";
   RadiusTime = "5";
   OffsetTime = "5";
   RotationTime = "5";
   LerpColour = "1";
   LerpBrightness = "1";
   LerpRadius = "1";
   LerpOffset = "1";
   LerpRotation = "1";
   StaticLight = "1";
   SpotLight = "1";
   SpotAngle = "41.9195";
   AdvancedLightingModel = "1";
   EffectsDTSObjects = "1";
   CastsShadows = "1";
   DiffuseRestrictZone = "0";
   AmbientRestrictZone = "0";
   LocalAmbientAmount = "0";
   SmoothSpotLight = "0";
   DoubleSidedAmbient = "0";
   LightingModelName = "SG - Original Stock (Lighting Pack)";
};

I did change the StaticLight to "1" (note: both spotLight datablocks are set to "0" by default)

Also noticed there is no way to modify ALL the parameters with the light editor. Nevermind--I thought I used to modify the fxLight via editor but checked and was using the dataBlock approach. (Is there a programming reason not to have the additional effects parameters accessible from the editor?)
#18
05/13/2005 (2:34 pm)
John,
Let me suggest a reorganization of the dataBlock info for clarity. I had undertaken this exercise when Melv came out with the fxLight and found it helped me quickly find parameters with common objectives:

datablock sgUniversalStaticLightData(sgBasicDataBlock) {

   [b]// Primary Controls[/b]
   className = "sgUniversalStaticLightData";
   LightOn = "1";
   Radius = "10";
   Brightness = "1.0";
   Colour = "1.000000 1.000000 1.000000 1.000000";
   StaticLight = "0";
   SpotLight = "0";
   SpotAngle = "19.4138";
   SmoothSpotLight = "0";
   AdvancedLightingModel = "1";
   EffectsDTSObjects = "1";
   CastsShadows = "1";
   DiffuseRestrictZone = "0";
   AmbientRestrictZone = "0";
   LocalAmbientAmount = "0";
   DoubleSidedAmbient = "0";

   [b]// Flare effects[/b]
   FlareOn = "0";
   FlareTP = "1";
   FlareBitmap = "common/lighting/corona";
   FlareColour = "1.000000 1.000000 1.000000 1.000000";
   ConstantSizeOn = "0";
   ConstantSize = "1";
   NearSize = "3";
   FarSize = "0.5";
   NearDistance = "10";
   FarDistance = "30";
   FadeTime = "0.1";
   BlendMode = "0";
   LinkFlare = "1";
   LinkFlareSize = "0";

   [b]// Brightness Animation[/b]
   AnimBrightness = "0";
   MinBrightness = "0";
   MaxBrightness = "1";
   BrightnessTime = "5";
   LerpBrightness = "1";
   BrightnessKeys = "AZA";

   [b]// Color Animation[/b]
   AnimColour = "0";
   MinColour = "0.000000 0.000000 0.000000 1.000000";
   MaxColour = "1.000000 1.000000 1.000000 1.000000";
   ColourTime = "5";
   LerpColour = "1";
   SingleColourKeys = "1";
   RedKeys = "AZA";
   GreenKeys = "AZA";
   BlueKeys = "AZA";

   [b]// Radius Animation[/b] 
   AnimRadius = "0";
   MinRadius = "0.1";
   MaxRadius = "20";
   RadiusTime = "5";
   LerpRadius = "1";
   RadiusKeys = "AZA";

   [b]// Offset Animation[/b]
   AnimOffsets = "0";
   StartOffset = "-5 0 0";
   EndOffset = "5 0 0";
   OffsetTime = "5";
   LerpOffset = "1";
   OffsetKeys = "AZA";

   [b]// Rotation Animation[/b]
   AnimRotation = "0";
   MinRotation = "0";
   MaxRotation = "359";
   RotationTime = "5";
   LerpRotation = "1";
   RotationKeys = "AZA";
};
#19
05/13/2005 (7:08 pm)
Hey Desmond...Haven't talked to you in a while. I have been using the spot light effect on my project. So far it seems to work pretty well.

www.igysoft.com/gg/image1.jpgwww.igysoft.com/gg/image2.jpgwww.igysoft.com/gg/image4.jpg
As you can see the rail cars and the crossing gates are dts static shapes and light very well. I have the sun light turned down way low and the sky textures turned off so you can see the effect better. Here is my datablock:
#20
05/13/2005 (7:12 pm)
I keep trying to post the datablock and keep getting this....

Forbidden
You don't have permission to access /mg/forums/result.thread.php on this server.


--------------------------------------------------------------------------------

Apache Server at www.garagegames.com Port 80

Anyone have any idea what I am doing wrong?? I am using the
code
block
Page «Previous 1 2