Scripts / Fading of decals in/out (transparency/alpha level)

Author
Message
Solar
7
Years of Service
User Offline
Joined: 11th Apr 2017
Location: South Africa
Posted: 23rd Nov 2017 08:30
Hi GameGuru people!

I've got a question regarding decals.

Is it possible to change the transparency (alpha level) of a decal, by means of a LUA script?

What I want to do is have a fog decal that changes it's transparency, depending on the distance the player is from the decal. The closer the player gets to the decal, the more transparent the fog decal becomes.

Are there any LUA commands that one can use to change the transparency of a decal?

Any help regarding this will be greatly appreciated.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd Nov 2017 17:07
i dont think we have any transparency controls yet - only show or hide.
can you not use the in game fog for your needs? you can at least adjust it's distance and intensity with lua
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Solar
7
Years of Service
User Offline
Joined: 11th Apr 2017
Location: South Africa
Posted: 24th Nov 2017 11:07 Edited at: 24th Nov 2017 11:12
@Smallg

Hi Smallg! Thank you for replying. I also use the in game fog, but what I also want to do is have multiple fog (or smoke) decals at certain places in the game, to enhance the atmosphere.

Currently, if you place a fog decal, the closer you get to it, the more unrealistic it looks. That is why I want the fog decal to fade out as you get closer to it.

In Unreal engine, you can have a fog decal that changes transparency as you get closer, it looks really cool. Maybe GG can benifit with a LUA command that allows one to change decal transparency.

As an example, the attached screenshot has in game fog as well as fog decals. The fog decals looks good from a distance, but looks unrealistic as you approach them.

Attachments

Login to view attachments
PM
Bolt Action Gaming
GameGuru Tool Maker
11
Years of Service
User Offline
Joined: 24th Oct 2013
Location: Harrisburg, PA (USA)
Posted: 24th Nov 2017 16:16
Smallg is pretty much a major authority on the broad spectra of Lua coding around here. I agree with his assessment; I don't know of any way to do on the fly transparencies.

One way to manage this would be to do a distance check to the player and disable them as they get too far away or too close. That way you're not crushing processing by animating decals far away and also disabling them when they get too chunky up close. Alternately you can try different methods. I like to make mine flat and parallel with the ground. that seems to give a nice effect vs putting them up vertically.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 24th Nov 2017 16:55
Move them away from the player as the player approaches, i.e. make sure the player can't get close enough to see the 'unrealistic' view of them.

You could also sink them into the ground as the player approaches and then hide them, that way they don't suddenly disappear which always looks weird.

The particle generator command could also be used but I've yet to see a full description of what the parameters mean for it so it's hard to predict what the result will look like. (for example see this thread: https://forum.game-guru.com/thread/218347#msg2582757)
Been there, done that, got all the T-Shirts!
PM
Bolt Action Gaming
GameGuru Tool Maker
11
Years of Service
User Offline
Joined: 24th Oct 2013
Location: Harrisburg, PA (USA)
Posted: 24th Nov 2017 17:02
Amen, the particle generator command literally is a hardcoded command to call the single particle (small grey smoke) available to game-guru. So for all intents and purposes it really doesn't do anything at all. It has no variability or modification available to it beyond changing the spritesheet manually.

I think the only way to OP would achieve his goal would be with a custom written shader, which is beyond my expertise and probably most on here.


AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 24th Nov 2017 18:18 Edited at: 24th Nov 2017 18:40


So what do all those parameters mean?
Been there, done that, got all the T-Shirts!
PM
Solar
7
Years of Service
User Offline
Joined: 11th Apr 2017
Location: South Africa
Posted: 24th Nov 2017 22:51
@ Bolt Action Gaming and AmenMoses.

Hi guys! Yeah, it doesn't seem like there is an existing command for decal transparency at the moment.

I feel that the particle generator is basically useless in it's current form, but I'm going to try the idea of sinking the decal into the ground as you approach it. Thanks for the tip, AmenMoses!

I'll try it out and see if it looks okay!
PM
Bolt Action Gaming
GameGuru Tool Maker
11
Years of Service
User Offline
Joined: 24th Oct 2013
Location: Harrisburg, PA (USA)
Posted: 26th Nov 2017 02:42
oh weird, that must be new since last I monkeyed with it, Amen! Sorry; I assumed it was the same as before.

Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 26th Nov 2017 09:53
Quote: "Yeah, it doesn't seem like there is an existing command for decal transparency at the moment"


No there aren't, and there probably won't for a while. Transparency in GameGuru at the moments is basically decided by the texture itself. You can however have animated transparency by using a sprite sheet and assigning the decal_animated shaders, but they would constantly loop and I don't think we can control the looping.

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.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 27th Nov 2017 00:57 Edited at: 27th Nov 2017 00:57
We really need 3D Particles. We had a particle system in FPSC.

Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
Bolt Action Gaming
GameGuru Tool Maker
11
Years of Service
User Offline
Joined: 24th Oct 2013
Location: Harrisburg, PA (USA)
Posted: 27th Nov 2017 14:44
ugh yeah, I wasn't around for that but that's a big step up from what we have now.
Solar
7
Years of Service
User Offline
Joined: 11th Apr 2017
Location: South Africa
Posted: 27th Nov 2017 17:04
@Teabone

Yeah, GG needs a good particle system like FPSC had.
PM

Login to post a reply

Server time is: 2024-12-23 00:54:25
Your offset time is: 2024-12-23 00:54:25