RenderStyle Shadow quiestion
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
- Posts: 127
- Joined: Wed May 31, 2017 5:39 am
RenderStyle Shadow quiestion
This is rather self-explanatory. I want to manipulate the the level of translucency of Shadow renderstyle because it's too opaque for my taste.
-
-
- Posts: 1693
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
Re: RenderStyle Shadow quiestion
Here is what the wiki says about the RenderStyle property (irrelevant parts omitted, emphasis mine):
and tweak the alpha value further depending on your tastes. However, the problem is that the above code is not exactly equivalent to just setting the renderstyle to shadow, as the actor will be drawn as a single color regardless of its alpha. I'm not sure that this is a bug, perhaps it's just the phrasing in the wiki that is somewhat confusing, which could also be due to English not being my first language.
And no, just setting the alpha when renderstyle is set to shadow won't work (unless it is set to 0, in which case the actor will not be drawn at all).
So, apparently, you should start with the following code:ZDoom Wiki wrote:
- 'Stencil' - actor is drawn as a single color. Use StencilColor property to set the color to use. Note that internally this sets the actor's renderstyle field to STYLE_Stencil, but if the Alpha value is set to something below 1.0, renderstyle will be set to STYLE_TranslucentStencil instead, and translucency will be enabled on the actor.
...- 'Shadow' - equivalent to black translucent stencil with an alpha of 0.3.
Code: Select all
class TestShadow : Actor
{
Default
{
RenderStyle "Stencil";
StencilColor "Black";
Alpha 0.3;
}
...
}
And no, just setting the alpha when renderstyle is set to shadow won't work (unless it is set to 0, in which case the actor will not be drawn at all).
-
- Posts: 256
- Joined: Mon Jan 09, 2023 2:02 am
- Graphics Processor: nVidia (Modern GZDoom)
Re: RenderStyle Shadow quiestion
From looking at the code it seems this was merely done as a distinct style to help keeping the CheckFuzz function clean, because it operates on a render style alone and has no access to other fields. So the only choice to keep this style of fuzz rendering working was to make a new style out of it.
-
- Posts: 127
- Joined: Wed May 31, 2017 5:39 am
Re: RenderStyle Shadow quiestion
Would it work if partial invisibility is picked up?Player701 wrote: ↑Tue Nov 26, 2024 3:12 am Here is what the wiki says about the RenderStyle property (irrelevant parts omitted, emphasis mine):So, apparently, you should start with the following code:ZDoom Wiki wrote:
- 'Stencil' - actor is drawn as a single color. Use StencilColor property to set the color to use. Note that internally this sets the actor's renderstyle field to STYLE_Stencil, but if the Alpha value is set to something below 1.0, renderstyle will be set to STYLE_TranslucentStencil instead, and translucency will be enabled on the actor.
...- 'Shadow' - equivalent to black translucent stencil with an alpha of 0.3.
and tweak the alpha value further depending on your tastes. However, the problem is that the above code is not exactly equivalent to just setting the renderstyle to shadow, as the actor will be drawn as a single color regardless of its alpha. I'm not sure that this is a bug, perhaps it's just the phrasing in the wiki that is somewhat confusing, which could also be due to English not being my first language.Code: Select all
class TestShadow : Actor { Default { RenderStyle "Stencil"; StencilColor "Black"; Alpha 0.3; } ... }
And no, just setting the alpha when renderstyle is set to shadow won't work (unless it is set to 0, in which case the actor will not be drawn at all).
-
-
- Posts: 1693
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
Re: RenderStyle Shadow quiestion
If you want to change the render style applied by partial invisibility, you will need to adjust its properties accordingly:EmperorGrieferus wrote: ↑Tue Nov 26, 2024 6:22 pm Would it work if partial invisibility is picked up?
Code: Select all
class MyBlurSphere : BlurSphere replaces BlurSphere
{
Default
{
Powerup.Mode "TranslucentStencil";
Powerup.Strength 70;
}
}
-
- Posts: 127
- Joined: Wed May 31, 2017 5:39 am
Re: RenderStyle Shadow quiestion
I see. It's kinda annoying that partial invisibility for spectre and blur sphere are regulated separately.
-
-
- Posts: 1693
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
Re: RenderStyle Shadow quiestion
Actually, you can set it in the hardware renderer options (look for "fuzz style"), but I don't think it allows you to adjust the alpha...
-
- Posts: 127
- Joined: Wed May 31, 2017 5:39 am
Re: RenderStyle Shadow quiestion
I mean, if it allowed for alpha adjustment, I wouldn't create this topic in the first place.
I've just thought that "Shadow" fuzz style is shader-based.