Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Krzysztof Narkowicz

Member Since 13 Aug 2010
Offline Last Active Today, 01:46 AM

Posts I've Made

In Topic: Spherical harmonics in pixel shader

18 April 2013 - 02:13 AM

Yes, you are on the right track. If you want to use normal maps, then you need to sample in pixel shader. You can find code for evaluating irradiance using given normal in the DXSDK samples (Samples\C++\Direct3D\IrradianceVolume/SHIrradianceEnvMap.fx).


In Topic: Software 3D Renderer - Do I really need Perspective Correction?

19 December 2012 - 09:22 AM

Depth should be also interpolated using perspective correction. Without it there will be some z-buffer artifacts in places where two triangles intersect / overlap. More or less visible, depending on triangle position and size.

BTW persp corr interpolation just for zbuffer is simple - just linearly interpolate 1/z in screen space.

In Topic: ToneMapping Clamping Exposure

17 October 2012 - 01:20 PM

You could try to use histogram for better control over tonemapping. There is a nice presentation from Valve about their tonemapping with histogram aproach: http://www.valvesoft...heOrangeBox.pdf

In Topic: Gaussian specular in UnrealEngine4

16 October 2012 - 01:39 PM

The problem is, that you want the integral to evaluate to 1 and not to "<= 1".


I did solve it for integral = 1. I just wrote it as <= 1. Thanks for noticing.

I wrote a brdf for BRDF explorer with "Mittring" specular.

[source lang="plain"]analytic::begin parametersfloat n 1 1000 100bool normalized 1::end parameters::begin shadervec3 BRDF( vec3 L, vec3 V, vec3 N, vec3 X, vec3 Y ){ vec3 H = normalize( L + V ); float Dot = clamp( dot( N, H ), 0, 1 ); float Threshold = 0.04; float CosAngle = pow( Threshold, 1 / n ); float NormAngle = ( Dot - 1 ) / ( CosAngle - 1 ); float D = exp( -NormAngle * NormAngle ); if (normalized) { D *= 0.17287429 + 0.01388682 * n; //D *= 0.34574858 + 0.02777364 * n; } return vec3(D);}::end shader[/source]

Now when you use mine aprox, then max albedo in BRDF explorer correctly comes up as 1, but when using yours it's 2. This means, that in yours aprox sometimes outgoing energy is two times greater than incoming. I believe it's because you did integrate over full sphere, instead of just upper hemisphere.

In Topic: Gaussian specular in UnrealEngine4

14 October 2012 - 02:14 PM

KriScg's approximation was off by about the factor 2.


I think it's because you are using wrong treshold 0.004 (it was 0.04 in the presentation).

PARTNERS