Sign in to follow this  
arno

Suppressing shadows of transparent objects

Recommended Posts

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
Help AVSIM continue to serve you!
Please donate today!

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

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

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

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

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

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:

<part>	<name>ac_cond_not_day</name>		<visible_in_range>			<parameter>				<code>(E:TIME OF DAY,enum)</code>			</parameter>			<minvalue>2.000000</minvalue>			<maxvalue>4.000000</maxvalue>		</visible_in_range></part>

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

Hi Arno, it's complicated a little because I use Middleman but it seems the makemdl version I'm using is dated September 2001 while the later SDK version is dated April 2002. I have to use the earlier version as it generates the xxxx_0.asm file, while the later one doesn't. This is what I do:1. Create the vehicle in gmax and export in the usual way. I add a flat plane in front of the vehicle and map the headlight texture onto it. At night it uses the xxxx_LM.bmp texture to display the headlight effect. I use transp.exe to define the zero colour index as transparent so the headlight plane is invisible at day. This all works fine - except for that darned shadow of the headlight plane!2. I add Dick's code to the xxxx_0.asm file to make it work as a dynamic object library.3. I use fsregen to create the object library. I've included part of the xxxx_0.asm file as an example. From your comments it sounds like it may be impossible to get rid of that shadow! Many thanks. Best regards, Chris**************************************************************; fsregen labels !!!! DO NOT REMOVE THIS LINE !!!;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------;; This file was automatically generated from C:AutoASMDynamic_objectsgmax_librarycar5.x; using the MakeMDL tool. Do not edit by hand, re-run the; tool instead.;; generated on 05/31/05 19:12:13;;--------- WARNING - WARNING - WARNING - WARNING - WARNING - WARNING ---------; BGL model for C:AutoASMDynamic_objectsgmax_librarycar5.x;; $Header:$;;----------------------------------------------------------------------------;; Final Status: 369 polys; Alpha Status: 0 polys; Light Status: 0 polys; Library Status: 0 polys;; Start Time: 05/31/05 19:12:13; Stop Time : 05/31/05 19:12:13;; Modeling units = 2.0000; Radius = 2.3383; Radius in meters = 2.3383; Radius in modeling units = 5;car5_topG0 label BGLCODE; Dynamic Code SHADOW_VPOSITION 0SUPER_SCALE Call_SphereTestG0DG0G0, 10000, 105, 16SHADOW_VICALL Draw_SphereTestG0DG0G0, 18hCall_SphereTestG0DG0G0 label wordVPOSITION Return_SphereTestG0DG0G0, 10000, 105, 0SUPER_SCALE Return_SphereTestG0DG0G0, 10000, 105, 16VINSTANCE_CALL Draw_SphereTestG0DG0G0, 18hSETWRD 2Ch, 25Return_SphereTestG0DG0G0 label wordBGL_RETURNDraw_SphereTestG0DG0G0 label word; End Dynamic Code BGL_BEGIN 0800h ; version = 8.00 TEXTURE_LIST_BEGIN TEXTURE_DEF TEXTURE_AIRCRAFT , <255,255,255,255>, 0.403114, "DYN_TEXB.BMP" ; 0 TEXTURE_LIST_END MATERIAL_LIST_BEGIN MATERIAL_DEF 0.000000,0.000000,0.000000,1.000000, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000 ; 0 MATERIAL_DEF 0.337255,0.337255,0.337255,1.000000, 0.337255,0.337255,0.337255, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000 ; 1 MATERIAL_DEF 1.000000,1.000000,1.000000,1.000000, 0.392157,0.392157,0.392157, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000 ; 2 MATERIAL_LIST_END VERTEX_LIST_BEGIN VERTEX_DEF -1.664000, -1.968000, 3.176000, -1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 0 part= 1 prim=0 VERTEX_DEF -1.664000, -1.968000, 3.176000, 0.000000,-0.956725, 0.290995, 0.000000,1.000000 ; 1 part= 1 prim=0 VERTEX_DEF -1.664000, -1.968000, -2.664000, -1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 2 part= 1 prim=0 VERTEX_DEF -1.664000, -1.968000, -2.664000, 0.000000,-0.956725, 0.290995, 0.000000,1.000000 ; 3 part= 1 prim=0 VERTEX_DEF -1.664000, etc etc.................

Share this post


Link to post
Share on other sites

Lou, thanks VERY much for the info. Unfortunately I'm not very familiar with asm code and I'm still trying to digest it! Best regards, Chris

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this