Can decals be displayed with fog?

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Can decals be displayed with fog?

Post by PrinceOfFunky »

Is there a way to let decals be displayed in a fog zone?
I love fog and projectors but they don't work together :<
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Can decals be displayed with fog?

Post by sektor2111 »

Why you don't look at those hacked compilations like OldSkool and read remarks from there as a nice lecture ?...

Me telling:
- I will not activate fog in my games;
- fog is bugging decals;
- I worked my ass to get them properly ON-Line - MonsterShadow on purpose in ALL my Games;
- given fore-mentioned things I do not care who does fog and why.
If anyone feels disturbed by my setup then give me another "Render" or get lost (in fog).
Red_Fist
Godlike
Posts: 2163
Joined: Sun Oct 05, 2008 3:31 am

Re: Can decals be displayed with fog?

Post by Red_Fist »

I think you can do some things by using "speciallit" for the deco-mesh in fogzones. I think it makes it show up like you can almost see it even through the fog but stays clear. I dunno, never really analyzed it myself.
Binary Space Partitioning
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Can decals be displayed with fog?

Post by nogardilaref »

The engine has a known bug in which decals are not able to attach to surfaces in fog zones.
There's actually a way to fix it, but it requires custom decal code and a custom Engine package.

Essentially, all you need to do, in terms of code, before attaching a decal, is to deactivate the fog in that zone, and once attached you just activate the fog again (bFogZone=False, and then bFogZone=True).

The problem comes then from the fact that bFogZone is declared as "const", so you're not supposed to be able to change it in UScript.
However, "const" properties (var const) are not truly constant in nature, a better modifier keyword for these properties would be "readonly", because that's what they are, and they're only evaluated in compile-time rather than in run-time.

So we can take advantage of this by simply making an Engine package variation with the "const" keyword removed from this particular property, and then use that Engine in compile-time so you can do things like bFogZone=True/False, but then in run-time you can just keep using the original Engine with the "const" in there, and it will still work.
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Can decals be displayed with fog?

Post by sektor2111 »

Constants can be changed with ConsoleCommand is not such a big deal. I'm using this way for some pathing task actor where I push up some teleporters because incoming bot will mess things. Another occurrence: I have buried some InventorySpot and removing paths from them as well. I did not use any other engine. Of course there are specific instances when you need to deal with an actor, console doesn't help in such case you have to rebuild files in unusual way...
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Can decals be displayed with fog?

Post by PrinceOfFunky »

Red_Fist wrote:I think you can do some things by using "speciallit" for the deco-mesh in fogzones. I think it makes it show up like you can almost see it even through the fog but stays clear. I dunno, never really analyzed it myself.
No I already tried this yesterday :/
nogardilaref wrote:Essentially, all you need to do, in terms of code, before attaching a decal, is to deactivate the fog in that zone, and once attached you just activate the fog again (bFogZone=False, and then bFogZone=True).
I just tried using ConsoleCommand but it doesn't work, I put the projector(working) with bFogZone set to false and then I set it to true at runtime, the projection just disappeared.
I would say that fog is built with lighting, and so changing the value of bFogZone wouldn't do anything, but I'm not sure about this.
EDIT: Wait, it works with standard decals, just not with projectors apparently.
nogardilaref wrote:So we can take advantage of this by simply making an Engine package variation with the "const" keyword removed from this particular property, and then use that Engine in compile-time so you can do things like bFogZone=True/False, but then in run-time you can just keep using the original Engine with the "const" in there, and it will still work.
Ohh hey, are you very sure of what you're saying? I was trying to do something like this with Postal2 but it turned out that I needed to do a lot to compile just one class, maybe this is not the same case tho.

EDIT2: Also, I just found a bug with the pulsegun, I'm not sure if it only happens in DM-Fetid:
Xx-TjlqxsLc
"Your stuff is known to be buggy and unfinished/not properly tested"
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Can decals be displayed with fog?

Post by nogardilaref »

sektor2111 wrote:Constants can be changed with ConsoleCommand is not such a big deal. I'm using this way for some pathing task actor where I push up some teleporters because incoming bot will mess things. Another occurrence: I have buried some InventorySpot and removing paths from them as well. I did not use any other engine. Of course there are specific instances when you need to deal with an actor, console doesn't help in such case you have to rebuild files in unusual way...
Indeed, you can, simply because of the fact that they can be changed in runtime, regardless of the way it's achieved.
Although when talking in terms of code, using commands is the very last resort one should use: they're much slower, far more limited, may have undesired side effects, in certain conditions may not even work at all.
PrinceOfFunky wrote:
nogardilaref wrote:So we can take advantage of this by simply making an Engine package variation with the "const" keyword removed from this particular property, and then use that Engine in compile-time so you can do things like bFogZone=True/False, but then in run-time you can just keep using the original Engine with the "const" in there, and it will still work.
Ohh hey, are you very sure of what you're saying? I was trying to do something like this with Postal2 but it turned out that I needed to do a lot to compile just one class, maybe this is not the same case tho.
On this one I am 100% sure. :mrgreen:

But you keep mentioning "projectors"... what do you mean exactly?
I thought you meant decals that you were coding up to act as projected images, but am I wrong in this assumption since you're mentioning Postal 2?
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Can decals be displayed with fog?

Post by PrinceOfFunky »

nogardilaref wrote:you keep mentioning "projectors"... what do you mean exactly?
I meant the class "Projector" from UT99ExtensionPack.
"Your stuff is known to be buggy and unfinished/not properly tested"
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Can decals be displayed with fog?

Post by Barbie »

PrinceOfFunky wrote:Also, I just found a bug with the pulsegun
You mean shooting through small walls with the beam? I guess that (bug) is well known...
I used that often in AS-Golgotha to destroy the crystal from outside^^.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Can decals be displayed with fog?

Post by PrinceOfFunky »

Barbie wrote:
PrinceOfFunky wrote:Also, I just found a bug with the pulsegun
You mean shooting through small walls with the beam? I guess that (bug) is well known...
I used that often in AS-Golgotha to destroy the crystal from outside^^.
Oh well I didn't know it /o\
"Your stuff is known to be buggy and unfinished/not properly tested"
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Can decals be displayed with fog?

Post by nogardilaref »

Well, in that case, if you want a fully working projector, even in fog areas, you have to build your own with the kind of fix I explained about.
Post Reply