Simple Dynamic Shadow for TSStatic TGE 1.5.2 - TGEA 1.8.1
by Jean-louis Amadi · 10/26/2009 (10:19 am) · 29 comments
Full update & bug fix
Please download the zip file, do a backup, install&test this resource with a clean install of TGE 1.5.2 or TGEA 1.8.1
There is 2 directory by version, original & modified, used modified in order to install resource(copy/paste file on clean install or merge for sources which already modified)
Used original in order to restore to a clean install.
NOTE: Relighting is longer with this ressource but it work also be patient in this case, only the first relightning has this drawback.
www.mediafire.com/file/minzngnjrrz/TSStatic-cast%20shadow.zip
recompile et it's ok.
Add $pref::TStatic::renderReplicantShadow = "1" or "0"; in prefs.cs client side.
In editor you can notice the new fields for shadow with the TSStatic object, if change the sun parameters with shadowCanMove & shadowCanAnimate parameter activated you can see the shadow which change in realtime.

Please download the zip file, do a backup, install&test this resource with a clean install of TGE 1.5.2 or TGEA 1.8.1
There is 2 directory by version, original & modified, used modified in order to install resource(copy/paste file on clean install or merge for sources which already modified)
Used original in order to restore to a clean install.
NOTE: Relighting is longer with this ressource but it work also be patient in this case, only the first relightning has this drawback.
www.mediafire.com/file/minzngnjrrz/TSStatic-cast%20shadow.zip
recompile et it's ok.
Add $pref::TStatic::renderReplicantShadow = "1" or "0"; in prefs.cs client side.
In editor you can notice the new fields for shadow with the TSStatic object, if change the sun parameters with shadowCanMove & shadowCanAnimate parameter activated you can see the shadow which change in realtime.

About the author
www.gamealchemy.fr
#2
10/26/2009 (8:25 pm)
i will try this week and i will post the result but the implementation will be very different i think due to TGE152 architecture.
#3
UPDATE:
Compiled successfully, but in your first step i had to change protected to public.
10/26/2009 (11:57 pm)
Thank you very much ! Will give it a try in AFX 1.8.1 :DUPDATE:
Compiled successfully, but in your first step i had to change protected to public.
#4
It compiles in 1.8.2, but i also had to change the protected section to public to get it to compile, but now it crashes my game when i enable it...
any clues anyone?
10/28/2009 (9:06 pm)
This sounds great, havent seen it in effect thoughIt compiles in 1.8.2, but i also had to change the protected section to public to get it to compile, but now it crashes my game when i enable it...
any clues anyone?
#5
In TSStatic class
add after "friend class TSStaticConvex;"
friend class sgShadowProjector;
I updated the code posted.
And it's ok.
10/29/2009 (12:22 am)
For protected key word, i forgot to mention this:In TSStatic class
add after "friend class TSStaticConvex;"
friend class sgShadowProjector;
I updated the code posted.
And it's ok.
#6
Btw, nice looking game ;)
10/29/2009 (7:30 am)
Thanks for the update and screens, works perfectly now !Btw, nice looking game ;)
#7
Btw. i don't get any errors, just a crash, ill do a debug and check it out, maybe post the log file...
EDIT:
Well, running it in debug actually gave me a pretty grave error i suspect. Now it crashes during mission loading giving this output:
if you want to view the whole console file i can post that too, but i would think this is the relevant part...
10/29/2009 (10:56 am)
hmm, applied the updates, and yeah that fixed the protected stuff, but now my engine crashes everytime i look at an sgLightObject for more than 5-10 sec's...Btw. i don't get any errors, just a crash, ill do a debug and check it out, maybe post the log file...
EDIT:
Well, running it in debug actually gave me a pretty grave error i suspect. Now it crashes during mission loading giving this output:
*** Phase 3: Mission Lighting Fatal: (c:torquetgea_1_8_2enginesourcegfxbitmapgbitmap.cpp @ 827) GBitmap::read: misunderstood format specifier
if you want to view the whole console file i can post that too, but i would think this is the relevant part...
#8
May be is it a TGEA 1.8.2 version bug, i finalize the TGE 1.5.2 version and i try under 1.8.2.
I highlight than I have not modified the files on GBitmap about "lighting & lightmaping" and dif structure, the error show a format problem, it seems.
To follow..
10/29/2009 (1:02 pm)
Sorry, i can not reproduce the error, even with several sgLightObject, different model, replicator and static models. I look at them long, I move around, above, I changed the parameters randomly but no error.May be is it a TGEA 1.8.2 version bug, i finalize the TGE 1.5.2 version and i try under 1.8.2.
I highlight than I have not modified the files on GBitmap about "lighting & lightmaping" and dif structure, the error show a format problem, it seems.
To follow..
#9
but i do have the Ubiq SSAO Kit implemented, and maybe its related to that...
ill do a fresh 1.8.2 and check it out...
10/29/2009 (1:27 pm)
hmm, i didn't touch the gbitmaps either...but i do have the Ubiq SSAO Kit implemented, and maybe its related to that...
ill do a fresh 1.8.2 and check it out...
#11
10/31/2009 (7:20 pm)
Outstanding......Thank you so much and keep up the great work.
#12
Does it allow TSStatic objects to self shadow?
Or to cast shadows on each other or players, npcs, etc?
Thanks.
10/31/2009 (11:25 pm)
Would anyone mind explaining more about this resource?Does it allow TSStatic objects to self shadow?
Or to cast shadows on each other or players, npcs, etc?
Thanks.
#13
In TGEA 1.8.1/1.8.2(similar code) TSStatic object can cast shadow also on Player & NPC in theory & self shadow, not yet tested in depht.
feel free to test more in depth, comment & report bug.
11/01/2009 (12:20 am)
TSStatic objects and replicant of fxShapeReplicator(eating performance) can cast shadows on terrain, and dif structure. And their shadows can be animate with the sun parameter or if their position/orientation change.In TGEA 1.8.1/1.8.2(similar code) TSStatic object can cast shadow also on Player & NPC in theory & self shadow, not yet tested in depht.
feel free to test more in depth, comment & report bug.
#14
11/01/2009 (2:23 am)
i tried using the resource on a modified 1.8.1 and its not working. all the check boxes and such are working but there are no shadows. and when i walk up to the object (presumably when i enter the bounding box) the game crashes instantly. the shots from 1.5.2 look very promising. i hope you can help me figure it out.
#15
Appreciate the TGE1.5.2 Port also. :)
11/01/2009 (6:52 am)
Looks really cool, I'll be checking this resource out soon.Appreciate the TGE1.5.2 Port also. :)
#16
George Tagmire:
I can help you but i don't know how your modification before installing this resource on 1.8.1 version impact this code. Can you post the "error" wich displayed in debug mode in your compilator, or post log file or both. Can you list the modifications that you put before installing this resource.
11/01/2009 (7:26 am)
Thank you to everyone for the interest you have shown.George Tagmire:
I can help you but i don't know how your modification before installing this resource on 1.8.1 version impact this code. Can you post the "error" wich displayed in debug mode in your compilator, or post log file or both. Can you list the modifications that you put before installing this resource.
#17
when i start my mission i select an object and check all the shadow related boxes. nothing happens so i assume it needs a relighting. so i relight the whole mission and still no shadow. walk up to the object and crash
11/01/2009 (12:28 pm)
i did a couple mods to the decal system for bullet holes and such and i made a camera offset on the player to make it an over the shoulder view. i have done nothing to change the lighting system until now.when i start my mission i select an object and check all the shadow related boxes. nothing happens so i assume it needs a relighting. so i relight the whole mission and still no shadow. walk up to the object and crash
Lighting Pack lighting system stats:
Interior Lexel Count: 0
Interior Lexel Illumination Count: 0
Interior Lexel Illumination Time (ms): 0.000000
Interior Lexel Illumination Time Total (ms): 0
Interior Lexel Diffuse Count: 0
Interior Object Count: 1
Interior Object Included Count: 0
Interior Object Illumination Count: 0
Interior Surface Included Count: 0
Interior Surface Illumination Count: 0
Interior Surface Illuminated Count: 0
Interior Surface Smoothed Count: 0
Interior Surface Smoothed Lexel Count: 0
Interior Surface Setup Count: 0
Interior Surface Setup Time Total (ms): 0
Interior Surface Merge Count: 0
Interior Surface Merge Time Total (ms): 0
Static Mesh BVPT Potential Occluder Count: 0
Static Mesh Cast Ray Mesh Count: 0
Static Mesh Surface Occluder Count: 0
Terrain Lexel Count: 2368927
Terrain Lexel Time (ms): 0.000263
Terrain Lexel Time Total (ms): 624
Successfully saved mission lighting file: 'scriptsAndAssets/data/missions/simple_968039a2sg.ml'
Scene lighting complete (9.516 seconds)
//-----------------------------------------------
First-chance exception at 0x005adff5 in Apollyon.exe: 0xC0000005: Access violation reading location 0x00000358.
Unhandled exception at 0x005adff5 in Apollyon.exe: 0xC0000005: Access violation reading location 0x00000358.
The program '[11212] Apollyon.exe: Native' has exited with code -1073741819 (0xc0000005).
#18
11/01/2009 (1:43 pm)
Ok i see the problem, i will update & post. 



Torque Owner Donnie Hutson Jr