Using addictive translucency in eduke
#3 Posted 27 November 2022 - 10:14 AM
This enables the alpha field, and provides blend modes 129 (screen), 130 (multiply) and 255 (additive 100%).
#4 Posted 27 November 2022 - 12:45 PM
NightFright, on 27 November 2022 - 09:24 AM, said:
Yes lol, it was a typo on my part.
Hendricks266, on 27 November 2022 - 10:14 AM, said:
This enables the alpha field, and provides blend modes 129 (screen), 130 (multiply) and 255 (additive 100%).
Thank you for your help, Hendricks266.
EDIT: How do I install it and where do I put it?
This post has been edited by Mav3r1ck: 27 November 2022 - 12:48 PM
#5 Posted 27 November 2022 - 02:14 PM
#6 Posted 27 November 2022 - 02:59 PM
So basically, I extract the contents into my "resources" folder and add the "include resources/blend.def" into my "duke3d.def" where the executable is located, correct?
The last part confused me a bit since I'm more hands on. I do know how to edit my CON files, but I don't know which editor you're referring to change a sprite's .blend member.
#7 Posted 27 November 2022 - 03:05 PM
#8 Posted 27 November 2022 - 03:14 PM
I also wanted to make the game's explosions and the bullet puffs use the blend effects like how in the psx version. Can I do this to or does this explanation not cover that?
#9 Posted 27 November 2022 - 06:07 PM
However, making things spawned during gameplay (like explosions) use blend modes requires some scripting. Actually accomplishing this effect is very easy, although it immediately jumps into what I'd consider more advanced CON scripting concepts.
To do this for the explosion sprite, you could do something like this:
appendevent EVENT_SPAWN { ifactor EXPLOSION2 { cstator 2 seta .blend 255 } } endevent
Place this code at the bottom of game.con and it will make explosion sprites render additive.
If everything I just said is Greek to you, then I'd highly recommend reading up on CON scripting.
This post has been edited by Reaper_Man: 27 November 2022 - 06:08 PM
#10 Posted 27 November 2022 - 07:13 PM
#11 Posted 27 November 2022 - 10:57 PM
#12 Posted 28 November 2022 - 04:35 AM
#13 Posted 28 November 2022 - 02:56 PM
This post has been edited by Mav3r1ck: 28 November 2022 - 02:56 PM
#14 Posted 28 November 2022 - 03:10 PM
#15 Posted 28 November 2022 - 04:14 PM
#16 Posted 30 November 2022 - 02:00 PM
This post has been edited by VGames: 30 November 2022 - 02:04 PM
#17 Posted 01 December 2022 - 12:52 AM
VGames, on 30 November 2022 - 02:00 PM, said:
Can you catch this happening in a screenshot?
#18 Posted 01 December 2022 - 05:56 AM
Danukem, on 01 December 2022 - 12:52 AM, said:
Yes I’m sorry I was gonna post a screen shot yesterday and got too busy. I’ve been sick for 3 days so I’m catching up on stuff. When I get home I’ll post a screenshot.
#19 Posted 01 December 2022 - 01:35 PM
Here's a pic. Notice how the purple plasma sphere further away in front of the explosions has that black ring around it? And the plasma sphere closest to you doesn't because it's not in front of the explosions? That's the issue.
Here's something odd to consider. In this following pic the red spheres in game have black rings around them like the plasma spheres do above when in front of the explosions but in this screenshot for some reason they don't at all. Could this be an issue with my GPU setup and not so much how the projectiles were scripted?
This post has been edited by VGames: 01 December 2022 - 01:41 PM
#20 Posted 01 December 2022 - 01:39 PM
VGames, on 01 December 2022 - 01:35 PM, said:
I see. It looks like the partially transparent pixels on the plasma are being rendered as black. I'll think about what if any CON or DEF tricks might workaround that, but it sure looks like a rendering bug.
#21 Posted 01 December 2022 - 01:41 PM
Danukem, on 01 December 2022 - 01:39 PM, said:
Check out what I just added in the above post.
#22 Posted 01 December 2022 - 01:44 PM
VGames, on 01 December 2022 - 01:41 PM, said:
I don't know but I maintain that it's a rendering glitch.
Also, upon looking at it more closely -- they don't really look black, it looks like the partially transparent parts aren't being rendered AT ALL, but the non-rendering goes all the way back to the map, instead of showing any sprites that should be rendered behind. If you zoom in you can see parts of the fence clearly in the "black" areas. So this theory is they only appear black because most of the map area behind them happens to be dark.
Do you use the alphacut command?
#23 Posted 01 December 2022 - 02:13 PM
#24 Posted 01 December 2022 - 02:14 PM
texture 5359 { pal 0 { file "SOB_SPRITES/PROJECTILES/5359.png" nocompress nodownsize } }
And here's the projectile code:
defineprojectile SC_MAIN PROJ_WORKSLIKE 36878 defineprojectile SC_MAIN PROJ_XREPEAT 8 defineprojectile SC_MAIN PROJ_YREPEAT 8 defineprojectile SC_MAIN PROJ_SPAWNS SCEXPLOSION defineprojectile SC_MAIN PROJ_BOUNCES 3 defineprojectile SC_MAIN PROJ_VEL 1000 defineprojectile SC_MAIN PROJ_VEL_MULT 2 defineprojectile SC_MAIN PROJ_EXTRA 48 defineprojectile SC_MAIN PROJ_ISOUND NB_IMPACT defineprojectile SC_MAIN PROJ_BSOUND NB_IMPACT defineprojectile SC_MAIN PROJ_HITRADIUS 0 defineprojectile SC_MAIN PROJ_OFFSET 150 action SC_MAINFRAMES 0 1 1 1 0 useractor notenemy SC_MAIN 0 SC_MAINFRAMES seta[].alpha 128 enda
And this is the code in the EVENT_GAME for some size control as it exits the gun:
case SC_MAIN ifpdistl 1000 sizeat 0 0 else sizeat 8 8 break
That's all the code for the projectile.
This post has been edited by VGames: 01 December 2022 - 02:15 PM
#25 Posted 02 December 2022 - 12:06 AM
You might avoid the headache just removing them
#26 Posted 02 December 2022 - 01:56 AM
When Duke is involved, there is almost always a workaround. Or a reacharound -- I forget which one.
#27 Posted 02 December 2022 - 03:06 AM
#28 Posted 02 December 2022 - 03:34 AM
Phredreeke, on 02 December 2022 - 03:06 AM, said:
That is not true. Supported images with alpha channels normally do display transparency correctly if they are sprites, at least down to the alphacut limit. You can see in his screenshot that the projectile closer to the player is rendered correctly, with the transparency increasing closer to the edges. It doesn't appear to go from opaque straight to 33%, it appears to have a continuous range.
It does have a different problem, though -- it is squished. If a sprite is supposed to be circular, it's a good idea to stretch it out horizontally (either in the source image, or by giving it more x-repeat than y-repeat) to compensate for that in the renderer.
Phredreeke, on 02 December 2022 - 03:06 AM, said:
That's true but the results would be the same as editing the image --- either way, part of the image gets cut out. Although it wouldn't surprise me very much if changing alphacut somehow interacted with rendering code and caused the glitch to go away.
#29 Posted 02 December 2022 - 04:20 AM
VGames, on 01 December 2022 - 01:35 PM, said:
I can't reproduce this with the code and assets you uploaded. What version of EDuke are you running? Post your eduke32.log and mapster.log files. Are you sure there are no other DEF tokens for this tile?
#30 Posted 02 December 2022 - 06:13 AM
lllllllllllllll, on 02 December 2022 - 12:06 AM, said:
You might avoid the headache just removing them
I have lots of other projectiles and effects that are made just like this. The shrinker spark for example is set up the exact same way and doesn’t have this issue. There’s something about these 2 projectiles that needs fixing. Plus they don’t look as nice without the blur. The main difference I can think of between the shrinker and these other 2 projectiles is they move much faster. Not sure if that could make a difference.
@reaper I’m not at my pc right now but I do have some of that code in my DEF from alien Armageddon that makes the muzzle flashes added to some of the weapons have blurred edges and blend properly. I can post the code when I get home. Maybe I’m missing something there or maybe it’s effecting these projectiles somehow even though the muzzle flashes I added that code for specifically are working just fine. And I’m using the latest version of eduke32
@dan I’ve been meaning to adjust the xrepeats for the orb like projectiles. That’s something I keep forgetting to do. Good catch.
This post has been edited by VGames: 02 December 2022 - 06:25 AM