Grass with __noshadow __nocollision solved

  • Hello IPACS,

    I generated some transparent grass, named it as grass__noshadow, also the texture.

    After conversion with the afs2_content_converter (version 1.5.17) the grass is:

    dark from the rear side and casts a shadow.

    What are the correct steps to get bright grass from both sides as seen on your trees (or the ORBX grass)

    Cheers, Thomas


  • TomSimMuc May 27, 2020 at 10:58 AM

    Changed the title of the thread from “Grass__noshadow” to “Grass__noshadow Problem”.
  • TomSimMuc May 27, 2020 at 11:16 AM

    Changed the title of the thread from “Grass__noshadow Problem” to “Grass__noshadow solved”.
  • TomSimMuc May 27, 2020 at 11:37 AM

    Changed the title of the thread from “Grass__noshadow solved” to “Grass__noshadow”.
  • Hi Thomas,

    Unfortunately, I don't have right now anything I would be able (allowed) to share.

    Just to be sure; what is the name of the plane where the grass texture is mapped on? That's what needs the __noshadow tag

    I don't know it that makes a difference but you should rename and convert the textures to grass_500_color.tif

    Kai

  • I haven't tried via Sktechup, only with 3DSMax and here's how it worked.

    Example for a patch of grass.

    1) in 3DSMax, rename each sub-object with the __nocollision__noshadow suffix =>

    In my example, Grass_Short_Medium is 1 single plane of grass like yours.

    In a scenery I would repeat it at several places :

    Grass_Short_Medium__nocollision__noshadow_001

    Grass_Short_Medium__nocollision__noshadow_002

    Grass_Short_Medium__nocollision__noshadow_003

    ...

    2) still in 3DSMax, group them all as a single object (in my example yverdon_Grass_obj), no more need for the __nocollision__noshadow suffix :


    With several patches of grass the group would look like that:

    yverdon_Grass_obj

    -> Grass_Short_Medium__nocollision__noshadow_001

    -> Grass_Short_Medium__nocollision__noshadow_002

    -> Grass_Short_Medium__nocollision__noshadow_003

    ...

    3) select yverdon_Grass_obj and proceed with export selected to export in your work folder as yverdon_grass.tgi

    4) edit the conversion tsc file to reflect this and lauch the converter

    Code
    <[tmsimulator_scenery_object][element][0]
        <[string8][type][object]>
        <[string8][geometry][yverdon_grass]>
        <[vector3_float64][position][6.616438 46.764901 0]>
        <[float64][orientation][0]>
        <[int32][autoheight_override][-1]>
    >

    5) launch the converter and test in AFS2

    That's the way I think I did it, but it's a very long time ago.

    As far as I remember, the object_transparent_atc type if for using a different shader so that grass looks more uniform.


    I think the __nocollision or __ noshadow tags must be given before exporting to TGI

    As you can see, there was no more mention of these tags in the TGI and texture files, and thus no mention either in the resulting TMB file, so it apparently has to do with how the TGI is being generated.

    There, I'm not sure the TGI exporter of MCX can handle it...

    In case you have AC3D, you may try the same as in 3DSMax.

    Cheers

    Antoine


    Cheers

    Antoine

    Config : i7 6900K - 20MB currently set at 3.20GHz, Cooling Noctua NH-U14S, Motherboard ASUS Rampage V Extreme U3.1, RAM HyperX Savage Black Edition 16GB DDR4 3000 MHz, Graphic Card Gigabyte GeForce GTX 1080 8GB, Power supply Corsair RM Series 850W, Windows 10 64 bit.

  • Maybe this is a limitation of Sketchup, I do not see, how to name internal objects.

    PS: naming the texture grass_color does not change the shadows.

    Hello,

    You can change the name of the object in the .tgi file generated by Model ConverterX.

    Simply edit it with notepad++ or a similar text editor before converting to .tmd

    Best, Sylvain

  • Hello,

    You can change the name of the object in the .tgi file generated by Model ConverterX.

    Simply edit it with notepad++ or a similar text editor before converting to .tmd

    That's a good point indeed, since MCX exports text-format TGI's. You may also want to try renaming in the dae file, that's also in text format.

    3DSMax on the opposite exports binary TGI's that cannot be explored with Notepad++

    Cheers

    Antoine

    Config : i7 6900K - 20MB currently set at 3.20GHz, Cooling Noctua NH-U14S, Motherboard ASUS Rampage V Extreme U3.1, RAM HyperX Savage Black Edition 16GB DDR4 3000 MHz, Graphic Card Gigabyte GeForce GTX 1080 8GB, Power supply Corsair RM Series 850W, Windows 10 64 bit.

  • Thank you Sylvain, Antoine, Kai and Rodeo

    Together you named all parts, which I needed for a solution with Sketchup.

    So let me summarize the way which worked for me:

    Create a texture with alpha grass.

    Apply it to a rectangle in Sketchup.

    Name the texture grass_color

    Export as grass_single.dae

    Import with MCX,

    and export as grass_single.tgi

    Also save texture grass_color.png

    Edit the tgi with Notepad++ and change this name line (here 23)

    This is the internal name, we were looking for.

    This is the only occurance where we need __nocollision__noshadow !

    Copy tgi, texture and tsc (with same names) into one folder and start the converter.

    The resulting tmb file can be used/ called like this in a tsc:

    I placed the grass with ObjectGen, therefore the multiple entries.

    however I still found that object_transparent_atc is needed or you get a dark backside.

    The resulting grass can be used on a runway and will not crash the aeroplane!

    Cheers, Thomas


    Edited once, last by TomSimMuc (May 27, 2020 at 7:41 PM).

  • TomSimMuc May 27, 2020 at 7:35 PM

    Changed the title of the thread from “Grass__noshadow” to “Grass with __noshadow __nocollision solved”.
  • Awesome!

    I just remembered that Stefan Schönberger once told me that one of both tags is not needed. Usually I use the transparent_atc for bushes with a few hundred polys. There I leave the shadows and collision on.

    Anyway, out of interest I made a test; the __noshadow is not needed (anymore?) if you want to have both removed.

    So,

    __nocollision -> No shadow, no crash

    __noshadow -> No shadow, but collison

    No tag -> Shadow + collision

    Kai

  • Great job Thomas !

    So, manually editing the text-format TGI generated by MCX is a free and quite easy workaround for people who have no access to 3DSMax.

    Anyway, out of interest I made a test; the __noshadow is not needed (anymore?) if you want to have both removed.

    So,

    __nocollision -> No shadow, no crash

    __noshadow -> No shadow, but collison

    No tag -> Shadow + collision

    Interesting! I'd guess this is due to the [ground_object_atc] argument that causes AFS2 to use a different shader for uniform diffuse lightning => a planar grass surface gets the same light whatever the plane orientation, thus no shadow casting.

    CORRECTION : Looking at Thomas' pictures in posts #1 an #3 my guess is obviously wrong : despite uniform, diffuse lighting on grass the sun still casts a shadow...

    Cheers

    Antoine

    Config : i7 6900K - 20MB currently set at 3.20GHz, Cooling Noctua NH-U14S, Motherboard ASUS Rampage V Extreme U3.1, RAM HyperX Savage Black Edition 16GB DDR4 3000 MHz, Graphic Card Gigabyte GeForce GTX 1080 8GB, Power supply Corsair RM Series 850W, Windows 10 64 bit.

    Edited once, last by Trespassers (May 28, 2020 at 12:19 AM).