Doom Comic
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > ZDoom, colored sector and weapons flash
 
Author
All times are GMT. The time now is 14:32. Post New Thread    Post A Reply
Simon666
Mini-Member


Posts: 81
Registered: 08-03


So i've been playing with Zdoom and my map is coming along really well. My only problem so far is when i step on a colored sector ( let's say a blue colored sector for exemple ) and pressing the fire button some of the weapons flash look uglier than others, especially the SSG, Chaingun and Rocket Launcher, is there any way to fix it or is there any Wad out there that somehow fix this? ( well, it's not really a bug, it's just not visually pleasant ) some screenshots of my map with the glitch in action:

http://img695.imageshack.us/i/ssgfiring.png/
http://img718.imageshack.us/i/rocketfiring.png/
http://img16.imageshack.us/i/chaingunfiring.png/

I reduced the screenshots size, but the quality is good enough to see
the problem. Thanks in advance!

Old Post 03-29-10 16:36 #
Simon666 is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Ahcruna
Junior Member


Posts: 172
Registered: 03-10


Nice looking maps (or at least what was shown in those tiny screens)

your running GZDoom right? Zdoom doesn't have that problem.

Anyway I have no clue if you can fix that with a setting or something, but you can however use a sector height trick to color the muzzle flash. but that limits what you can do in that sector, not to mention you can't draw sky's as far as I know. so it's more of an unnecessary hassle =)

Here is a map (note: don't run this on the regular zdoom since it's pointless there)

Old Post 03-29-10 17:39 #
Ahcruna is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7130
Registered: 01-03


Don't do any hacky stuff here. I'm aware of the problem and I concur that something needs to be done about it. The problem is just that right now I don't know what. Once I get the right idea to address this in the engine I'll do.

Old Post 03-29-10 21:20 #
Graf Zahl is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Simon666
Mini-Member


Posts: 81
Registered: 08-03


Good to know that, i think that colored sector can add a lot of atmosphere to a level!

Old Post 03-30-10 13:34 #
Simon666 is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
DaniJ
Senior Member


Posts: 1740
Registered: 08-03


The same issue is currently present in Doomsday too. Like Graf said, its best that authors do not try to do anything about it. It can be solved in engine.

@Graf What are your thoughts on this? I've personally already tried a linear blending of the sector light colour and "fullbright" but that didn't look too great to me.

Old Post 03-30-10 14:03 #
DaniJ is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
andrewj
Senior Member


Posts: 1379
Registered: 04-02


Is this because the flash sprite is fullbright and hence not getting colored since the colormap emulation tends to pure white at the fullbright end?

Old Post 03-30-10 14:14 #
andrewj is online now Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7130
Registered: 01-03



DaniJ said:

@Graf What are your thoughts on this? I've personally already tried a linear blending of the sector light colour and "fullbright" but that didn't look too great to me.



The only option I see is to use something like GZDoom's brightmaps and use a shader to mix them (or split them into 2 textures if you don't want to use shaders.) But this will inevitably require IWAD dependent data in the engine somewhere.



andrewj said:
Is this because the flash sprite is fullbright and hence not getting colored since the colormap emulation tends to pure white at the fullbright end?


Yes. Unlike ZDoom's software renderer GZDoom treats fullbright properly and always renders it with white light so the weapon parts of the flash sprite stand out.

Old Post 03-30-10 14:33 #
Graf Zahl is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Simon666
Mini-Member


Posts: 81
Registered: 08-03


Perhap not 100% on topic, but it seem that running GZDoom in software mode fixed the problem of colored sectors, however most ( if not all )
of the textures and sprites are totally screwed, it's like i'm running the map on a acid trip or something...

http://img243.imageshack.us/i/screwedcolors.png/


Does it have anything to do with the fact that the new textures i'm using were imported in png format? I double-checked everything in Doombuilder and XWE and nothing seem unusual.

Old Post 03-30-10 15:28 #
Simon666 is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
DaniJ
Senior Member


Posts: 1740
Registered: 08-03



Graf Zahl said:

The only option I see is to use something like GZDoom's brightmaps and use a shader to mix them (or split them into 2 textures if you don't want to use shaders.) But this will inevitably require IWAD dependent data in the engine somewhere.


I'm not willing to go down the route of additional IWAD-specific resources. For the simple reason that it is but a work around for the original IWAD psprites, with PWADs obviously continuing to suffer the same problem.

Even using a shader so that you can "overbright" the results I don't think this will look right.

Perhaps we need to consider using the opacity of the flash psprite as a mask some how.

Old Post 03-30-10 15:55 #
DaniJ is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7130
Registered: 01-03


But how will you generate such a mask? That's precisely my problem here. I can't think of anything that would be able to auto-generate it.

Old Post 03-30-10 16:00 #
Graf Zahl is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
DaniJ
Senior Member


Posts: 1740
Registered: 08-03


Well if you consider that the flash is basically a mask already except that areas of no change are the same as the other it should be possible to produce a mask from them. Iterate over the flash psprite pixel data, comparing the color and alpha to that in the normal psprite data. If equal there is no difference so the resultant alpha is zero.

Would work, no?

EDIT: Fixed algorithm proposal and removed misleading sentence which alluded to a GL blending method at the drawing stage, which may not be necessary.

Last edited by DaniJ on 03-30-10 at 16:40

Old Post 03-30-10 16:07 #
DaniJ is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7130
Registered: 01-03


That may work for the chaingun but not for the plasmagun and rocket launcher

Old Post 03-30-10 17:28 #
Graf Zahl is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
DaniJ
Senior Member


Posts: 1740
Registered: 08-03


Any particular reason? I can't foresee a problem, looking at them in an image editor...

Old Post 03-30-10 17:36 #
DaniJ is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7130
Registered: 01-03


Not all flash sprites are masks. Some are full overlays and in some the underlying base sprite is altered a bit (e.g for some highlights)

Old Post 03-30-10 19:31 #
Graf Zahl is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
DaniJ
Senior Member


Posts: 1740
Registered: 08-03


That shouldn't pose a problem. Once you have the mask, use an algorithm similar to the ColorOutlines method used to spread color into the masked area for sprites and textures but rather, this algorithm will blur the edges of the mask into the non-masked area (naturally, only do this where a source pixel is present in both normal and flash psprites). Draw the flash as normal but with the resultant mask.

Its never going to yield ideal results though it will look far better than what we currently get.

Edit: Created a mockup of the results of such an algorithm to possibly clarify it: http://dengine.net/wip/pspritemask.psd
All actions taken in the creation of this mockup can be implemented relatively easily algorithmically.

Last edited by DaniJ on 03-30-10 at 21:24

Old Post 03-30-10 21:05 #
DaniJ is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 7036
Registered: 07-07


Not sure it would be that simple...
http://img691.imageshack.us/img691/2695/plasma.gif
As you can see, here (PLSGA0 and PLSFB0) the flash sprite is used to actually change the entire weapon slightly. The shapes do not correspond.

Old Post 03-30-10 21:12 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
DaniJ
Senior Member


Posts: 1740
Registered: 08-03


In which case, there will be nothing left of the underlying psprite visible or what will be - will be the same color so it won't matter. See the mockup I made using MISG as an example. If it would help I could do the same with plasma rifle?

Remember the goal is not to light the fullbright areas but to blend the "border" between them and the non-fullbright areas.

Edit: Although, the algorithm could be improved so that rather than a linear blur, the distance and degree of which is a function of the color difference delta between normal and flash psprites and their position relative to the border. Though naturally this is a quite a bit more expensive.

Last edited by DaniJ on 03-30-10 at 21:54

Old Post 03-30-10 21:29 #
DaniJ is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 14:32. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > ZDoom, colored sector and weapons flash

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Forums Directory