Suppressing shadows of transparent objects

Recommended Posts

Guest cwright

Hello all, Having come up against a brick wall with AutoAsm dynamic objects (see my other post!) I thought I would try making some better dynamic traffic objects. I've added illuminated headlights for the cars and that works pretty well. In gmax I simply added a flat plane in front of the car and mapped the headlight effect onto it, using the -LM night texture. The day texture sets the plane to transparent, so it's invisible in daytime. Unfortunately, although it's invisible it still casts a shadow, which looks rather odd. Is there any way to suppress shadows for part of the model? Many thanks. Best regards, Chris

Share this post

Link to post

Share on other sites

I think if you only want part of the shadow, you will have to make your own shadow model. This is possible, but would take some work of course. You could use a very simple shape for this model, that would also improve the performance.

Share this post

Link to post

Share on other sites

Guest cwright

Lou, many thanks for the suggestion. I set opacity to 99 but it made no difference. The main texture is set to transparent (using transp.exe) and there is a night _LM.bmp texture. Would that make any difference? Best regards, Chris

Share this post

Link to post

Share on other sites

Guest cwright

Hi Dick, thanks for the suggestion. Unfortunately my exporter is set up to use Middleman and the makemodel doesn't have a LOD tab. But if the 99% setting can't be made to work I'll de-install Middleman and have a go. By the way, did you see my other post about dynamic objects? (AutoAsm / dynamic objects problem). This is a major problem that reduces the effectiveness of this feature. Nobody had any comments or suggestions - is this maybe because there is no solution? It would be useful if I could know either way! Best regards, Chris

Share this post

Link to post

Share on other sites

Guest Firestriker

Chris,These settings should work when applied to a simple plane object at ground level in front of your vehicle. I have included my texture files in the zip.http://forums.avsim.net/user_files/122550.gifYou could go so far as to edit the _0.asm file and put a time of day display condition on these polys too.Lou

Share this post

Link to post

Share on other sites

Hi Chris.I never answered your other post because I don't know much about dynamic objects!As far as the shadow, I seem to recall the shadows of dynamic objects are actually aircraft shadows. They aren't treated in the sim as ground objects. Maybe Arno knows more about this.Perhaps using tranparency doesn't affect airplane shadows, so it doesn't affect dynamic object shadows?Dick

Share this post

Link to post

Share on other sites

Guest cwright

Lou, thank you very much indeed. Unfortunately it's still no joy. I configured the material as you show it except for one thing: the Ambient Color entry was ghosted and I couldn't enter anything. But FS uses the _LM texture automatically, so it's okay. The only other difference I can see is that I'm using bmp textures and not tga. One thing just occurred: to create a dynamic object library I add some code to the xxxx_0.asm that Dick L. gave in a post some time ago. Could that have an effect? Was your bus example a dynamic object? Adding a time of day condition into the asm file could be ideal (maybe with better frame rates as well) but I've absolutely no idea how to do that. I did a forum search but no joy. I'd be very grateful if you could give me some pointers on this. Many thanks. Best regards, Chris

Share this post

Link to post

Share on other sites

Guest Firestriker

Hi Chris,No, the bus is a static scenery object so that blows that process for a dynamic object. I messed around last night with an aircraft model working mainly on the prop and Dick is right, the shadow does not change with the opacity setting of a particular part as it does in a static scenery object. So it would seem that you would need to either remove the shadow model altogether or make a separate shadow model... something I have not ever done but have read that it can be done.As to the TOD conditional display. Some time back I did some experimentation with this in an aircraft model and came up with this:

The way you use is it is to add the above code to the makemdl.parts.xml file. (Note: makemdl.parts.xml only works with FS2004 aircraft models) Then make a dummy node, usually a tiny box or single triangle and you can even delete the geometry so you simply have just a pivot point left. This dummy node is usually hidden somewhere in the other geometry and is named ac_cond_not_day. Then you link the parts you want this condition to affect to this dummy node. For FS2002 you can use the dummy node as a marker to make finding the place in the *_0.asm file easier to find. I'd use a triangle and keep the geometry in this case. Remember, do not have makemdl.exe set to Optimize because you might loose your part names in the *_0.asm file. This is similar to adding this type of condition to a part/parts in the *_0.asm file.IFIN1 labelname, var, con1, con2; the code you want only to display in the certain conditionlabelname label wordin this case IFIN1 labelname, tod, 2, 4orIFIN1 labelname, 028c, 2, 4Next, you run into the problem that not all variables are avalible to dynamic scenery objects as they run in their own little world, so to speak. So you have to besure that you use one that is avalible or use an override command in your *_0.asm file before the condition like so (this is for a strobe light):BGL_FTAG "l_light_strobe", 0.00 ; Node 55 ; Node 55 - l_light_strobe transform: BGL_TRANSFORM_MAT -59.649437,-24.929823,7.149998, 1.000000,0.000000,0.000000, 0.000000,1.000000,0.000000, 0.000000,0.000000,1.000000 VAR_BASE_OVERRIDE VAR_BASE_GLOBAL IFMSK nolgt_15, beacnt, 00002h BGL_LIGHT LIGHT_STROBE, 0.000, -0.000, 0.102, 40, 0.60, 0.40, 0FFFFFFFFh, 0.000000, 0.000000, 1.000000 ; source poly num = 2180 nolgt_15 label BGLCODE BGL_TRANSFORM_END ; Transform l_light_strobe I hope this is not too confusing!Lou

Share this post

Link to post

Share on other sites

Hi Chris,I don't have a real answer, but which GMax gamepack are you using? Are you using the Fs2002 gamepack and then using something like FsRegen to create the library? In that case I think you can not do much about the shadow, as that information is not stored in the library.

Share this post

Link to post

Share on other sites

Hi Arno.I think Chris must use MakeMDL from FS2002 to make dynamic objects. You are probably right that the shadow info is created from the object's shape... not controlled in the BGL.I'm working 7 days a week for the next 2-3 weeks so I don't have much time to tinker with this. :(Dick

Share this post

Link to post

Share on other sites

Guest cwright

Lou, that's brilliant! Thank you very much. I installed the bus and AutoAsm quickly spewed out lots of them. http://www.kline.demon.co.uk/lou_bus.jpg Now I'll go through it and see if I can reproduce your method. Many thanks. Best regards, Chris

Share this post

Link to post

Share on other sites

Hi Chris,I see some hope :).In your ASM code I see a SHADOW_VICALL command. Could you try to comment that out for the moment? If that removes your total shadow, then you can use a different shadow model for your bus. If that does not help, I think the shadow is generated beyond our control.

Share this post

Link to post

Share on other sites

Guest cwright

Lou, Success! At first it looked pretty complicated and I was going to ask you about something I didn't understand. But then I had a thought. Part of the process was adding the three lines of code to the xxxx_0.asm to create the time of day condition. I wondered if it would work if that was all I did. And it worked! So my procedure is:1. Create the object with gmax, with keep files enabled.2. Add Dick's code at the start of xxx_0.asm3. Add your three lines of code to xxxx_0.asm for the time of day condition.4. Create the library with fsregen.5. Have a good curse when those ***&&&!!! shadows still appear in Flight Simulator. I'm happy to report that Step 5 is not required. The car has a shadow but not the headlight plane. Here are the results: http://www.kline.demon.co.uk/dyn_11.jpghttp://www.kline.demon.co.uk/dyn_10.jpg Lou, thank you very much for this. I'll buy you a virtual beer. Whet's more, I'll even drink it for you! Best regards, Chris

Share this post

Link to post

Share on other sites

Hi All.As an aside, we can have defined shadows in dynamic code.Arno wanted to know whether shadows can be defined separately from the object shape in dynamic objects. The answer is yes.Here's "Dynamic_Shadow_Test.asm", which defines one dynamic library object using "Dynamic_Shadow_Test_0.asm" as the object and "Dynamic_Shadow_Test_1.asm" as the shadow. Any *_0.asm output from Gmax/MakeMDL FS2002 should work. The scale is assumed as 0.5 standard FS2002 Gmax output. That translates to 15 in the Super_Scale command... this object being a "radius" of 41... equaling 82 for that command. By "radius", I mean that it more accurately describes diameter.... the size of a box that would hold the object.This is a dynamic sphere that has a cube's shadow:

Share this post

Link to post

Share on other sites

Guest cwright

Arno, thanks for the suggestion. It certainly got rid of the shadow. Unfortunately it got rid of the object as well! (i.e. nothing appeared). Happily Lou's time of day suggestion works nicely. Best regards, Chris

AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

Donation Goals

AVSIM's 2019 Fundraising Goal

Donate to our annual general fund. This donation keeps our doors open and providing you service 24 x 7 x 365. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. We reset this goal every new year for the following year's goal.