2 registered members (Akow, 1 invisible),
1,423
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: pp bloom in gamestudio
[Re: Scorpion]
#169237
11/29/07 15:58
11/29/07 15:58
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
Expert
|
Expert
Joined: May 2005
Posts: 2,713
Lübeck
|
I am not done with that wiki section yet (adding "my" shadercollection and try to put some of the shaders to an other site, so that on the main shadersection is only a selection of the most usable shaders and so on...) and it will take me some time to add the code, since I´m learning for school at the moment (you see why I am posting that much )...^^ But I will definatly add it soon Sorry for going off-topic...
|
|
|
Re: pp bloom in gamestudio
[Re: Excessus]
#169241
12/27/07 15:24
12/27/07 15:24
|
Joined: Oct 2003
Posts: 827 22�21'24"N 114�07'30"E
Frederick_Lim
User
|
User
Joined: Oct 2003
Posts: 827
22�21'24"N 114�07'30"E
|
Quote:
Quote:
if((Color.r+Color.g+Color.b)/3<vecSkill1.x) { Color.rgb = 0; }
I think you will get a better quality bloom if you just calculate the luminance instead of making dark parts black. You can calculate luminance like this: float lum = dot(color, float3(0.299f, 0.587f, 0.114f); return (float3)lum;
Then just blur it and blend with the original render like you already do.
If I try to replace the lines I got the error:
Quote:
mtlBlackout(15): error X3017: cannot implicitly convert from 'float3' to 'float4' > return (float3)lum; <
Please help. Thanks in advance.
|
|
|
Re: pp bloom in gamestudio
[Re: Frederick_Lim]
#169242
12/28/07 06:11
12/28/07 06:11
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
float lum = dot(color.rgb, float3(0.299f, 0.587f, 0.114f));
Color is usually a float4 (R G B A), but here you only need (R G B)
xXxGuitar511 - Programmer
|
|
|
Re: pp bloom in gamestudio
[Re: Frederick_Lim]
#169244
12/28/07 17:03
12/28/07 17:03
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
oh, sorry. my mistake... I should have paid more attention. The problem is in the return (as highlighted by the error ). return float4((float3)lum, 1.0); The shader expects a return value for alpha transparency. Since it's bloom, we don't need transparency.
xXxGuitar511 - Programmer
|
|
|
|