Tutorials & Guides / Fixing transparency issues on foliage / trees

Author
Message
Wolf
Forum Support
17
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 13th Mar 2020 18:57 Edited at: 13th Mar 2020 18:59
Hey gang!

I've noticed several times lately that people post screenshots where their foliage is not working as intended. Mainly you get transparency glitches obscuring objects directly behind the barks/leaves of trees or bushes. There are a few simple and quick things you need to adjust to fix your media.

1. step: Make sure you have the line "Transparency = 5" in your .fpe file. If not, add it.
2. step: If the error persists, make sure to change the shader assigned in the .fpe . Replace "entitybasic.fx" with "apbr_tree.fx" (or the foliage counter part for other vegetation.)
3. step: If the above has not fixed your problem: Use paint.net or your preferred art program to make sure that the transparent part of the texture is NOT touching the borders of the texture. Meaning there should be a pixel or 2 of pure transparency from every border of the image. No branch or leaflet should touch the border of the texture. I do not know why this works, but it does and fixes even the more stubborn ones.

I'd also like to add: Whenever you edit the .fpe files of your foliage you can also make sure that the material index for your trees is set to "3" for wood. It will make sure it does not have any unwanted reflections or metallic sheen.

You can also set collision mode to 11 for something to not have collision

Thats the whole run down! Let me know if you have any questions.
m2design
GameGuru TGC Backer
14
Years of Service
User Offline
Joined: 25th Mar 2010
Location:
Posted: 13th Mar 2020 22:23 Edited at: 13th Mar 2020 22:34
Quote: " Mainly you get transparency glitches obscuring objects directly behind the barks/leaves of trees or bushes. There are a few simple and quick things you need to adjust to fix your media."


Not sure if I understand. Why would I ever want to add a transparency command to a FPE file of a tree? I create my own trees so maybe that is why I don't observe the problem you refer. If you have time, would take a look at the attached image and let me know if you feel the trees in the image have what you refer. I always use the apbr_tree.fx shader but never use "transparency" on a tree

When I have transparent window glass in my models that FPE file always uses transparency = 2. If the model is to be placed in the water then the FPE file must contain Transparency = 8

I admit I use transparency commands in my grasses and bush FPE files for effect (Again please reference the screen shot.)

Windows 10 creator,64 bit| Intel i7-7700 @3.60GHZ Quad|CPU PASSMARK 10,794|Memory 16GB |NVIDIA GEFORCE GTX 1070|GPU PASSMARK 11,071

Attachments

Login to view attachments
Earthling45
8
Years of Service
User Offline
Joined: 3rd Sep 2016
Location: Zuid Holland Nederland
Posted: 14th Mar 2020 00:39
Quote: "I'd also like to add: Whenever you edit the .fpe files of your foliage you can also make sure that the material index for your trees is set to "3" for wood. It will make sure it does not have any unwanted reflections or metallic sheen."


Thanks for this tip Wolf, after importing a tree i did notice shiny spots on leaves.
I'll set it and see if this is the cure.
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 14th Mar 2020 16:43
Quote: "Why would I ever want to add a transparency command to a FPE file of a tree?"


It depends on how you make your trees, the common way to make trees is to use a plane for a clump or bush of leave, that plane will be a flat square with a texture of the leaves on it, the texture will be transparent wherever it doesn't have leaves, those need to have transparency set.

The transparency "command" (it's not a command it's a setting) tells the engine which layer to render the transparency.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Primary Laptop:
i5, NV1050 4GB, 8GB memory, 1x 1TB HDD, Win10.

Secondary Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Wolf
Forum Support
17
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 15th Mar 2020 17:27
@m2design: It depends on how you design your trees. In the attachment you can see trees where the issue is present

Attachments

Login to view attachments
m2design
GameGuru TGC Backer
14
Years of Service
User Offline
Joined: 25th Mar 2010
Location:
Posted: 15th Mar 2020 19:26 Edited at: 25th Apr 2020 21:20
@Wolf
Understood, thanks for taking the time to illustrate the issue with the attachment. I certainly agree that how the tree is created and using the correct shader will impact the model. Again thanks for the clarification.


Windows 10 creator,64 bit| Intel i7-7700 @3.60GHZ Quad|CPU PASSMARK 10,794|Memory 16GB |NVIDIA GEFORCE GTX 1060|GPU PASSMARK 11,071

Attachments

Login to view attachments
Preben
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 1st Apr 2020 10:44
Just to add: Another reason to use the correct shaders like "apbr_tree.fx" , is that the draw call optimizer will then work on your non animated foliage and give you a huge fps increase.
Subscribe and checkout great GameGuru/AGK video's here: Videos click here
Latest GameGuru Loader news: News click here
Get GameGuru Loader PBR version here: Steam click here
best regards Preben Eriksen,
lotgd
3D Media Maker
14
Years of Service
User Offline
Joined: 2nd Apr 2010
Location: italy
Posted: 3rd Apr 2020 23:23 Edited at: 3rd Apr 2020 23:28
it is the fourth time that I have fixed some models, and they become non-transparent again, this happens when they update gameguru. Absurd!

I tried all the solutions and they don't work, I just have to add the pixels in the border as a last resort..

(edit : sorry, I thought it was for the transparencies of any model, not just the foliage)

Pc Specs : Win10pro64bit /Msi Night Elf / i7 7700k / gtx1070 / 16gb ram ddr4 / SSD 850Evo
Laptop : i5 4200u- 8gb ddr3 - Nvidia Gt 920 2gb - 1tb hdd

Login to post a reply

Server time is: 2024-11-21 11:21:59
Your offset time is: 2024-11-21 11:21:59