Page 1 of 1

[2.1] HDR sample

Posted: Mon Sep 07, 2015 5:49 pm
by TaaTT4
Hi,

I have two questions about the HDR sample.

For what I know (and I have understood), after the bright pass the texture has to be blurred.
This is done, by ping-ponging the texture between the rtBlur0 and the rtBlur1, applying alternately an horizontal and a vertical blur pass.
But the last four render_quad passes always apply an horizontal blur.
Is it intended or is a cut and paste error?

Why the NUM_SAMPLES define is different between the horizontal blur shader and the vertical one?


Thanks,
Raffaele.

Re: [2.1] HDR sample

Posted: Mon Sep 07, 2015 6:42 pm
by xrgo
its just the style, because matias likes asymetric bloom/lens flare jj ambras style lol
its a nice effect but if you need symetic/round bloom (like I did) you have to:
-removed those extra renderquads
-equal the NUM_SAMPLES for both shaders
-change this:

Code: Select all

fragment_program HDR/BoxBlurV_ps unified
{
	delegate HDR/BoxBlurV_ps_GLSL
	delegate HDR/BoxBlurV_ps_HLSL
	
	default_params
	{
		param_named_auto	invTex0Size				inverse_texture_size 0
	}
}
to this:

Code: Select all

fragment_program HDR/BoxBlurV_ps unified
{
	delegate HDR/BoxBlurV_ps_GLSL
	delegate HDR/BoxBlurV_ps_HLSL
	
	default_params
	{
		param_named_auto	invTex0Size				inverse_texture_size 1
	}
}
-and this:

Code: Select all

	texture rtBlur0	256 256 PF_A2R10G10B10	depth_pool 0
	texture rtBlur1	256 256 PF_A2R10G10B10	depth_pool 0
to this:

Code: Select all

	texture rtBlur0	target_width_scaled 0.25 target_height_scaled 0.25 PF_A2R10G10B10	depth_pool 0
	texture rtBlur1	target_width_scaled 0.25 target_height_scaled 0.25 PF_A2R10G10B10	depth_pool 0
(or whatever scale you want)

this way you'll have a perfect symetric bloom no matter the resolution... or simply cook NUM_SAMPLES so it looks like you want, but it will not behave correctly at some resolutions/ratios

Re: [2.1] HDR sample

Posted: Tue Sep 08, 2015 9:47 am
by TaaTT4

Code: Select all

fragment_program HDR/BoxBlurV_ps unified
{
   delegate HDR/BoxBlurV_ps_GLSL
   delegate HDR/BoxBlurV_ps_HLSL
   
   default_params
   {
      param_named_auto   invTex0Size            inverse_texture_size 1
   }
}
Why do you use 1 as texture unit index?
The material which use the HDR/BoxBlurV_ps shader does not have just a single texture unit?

Re: [2.1] HDR sample

Posted: Tue Sep 08, 2015 1:27 pm
by xrgo
TaaTT4 wrote:

Code: Select all

fragment_program HDR/BoxBlurV_ps unified
{
   delegate HDR/BoxBlurV_ps_GLSL
   delegate HDR/BoxBlurV_ps_HLSL
   
   default_params
   {
      param_named_auto   invTex0Size            inverse_texture_size 1
   }
}
Why do you use 1 as texture unit index?
The material which use the HDR/BoxBlurV_ps shader does not have just a single texture unit?
Oh yes, you're right I did put a texture unit, although I think somehow it was working before, I just thought it was wrong and put one from the beginning, didn't test much