Jump to content

  • Log In with Google      Sign In   
  • Create Account


We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.

Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!

Tasty Texel

Member Since 16 Jun 2011
Offline Last Active Yesterday, 04:34 AM

#5159667 cosine term in rendering equation

Posted by Tasty Texel on 10 June 2014 - 11:41 PM

I'm trying to reconcile that with the ideal diffuser (Lambert) case now... The lambert BRDF is just "k" (diffuse colour), so for a white surface we typically just use dot(N,L) in our per pixel calculations.
If we incorporate the view angle through, we get dot(N,L)/dot(N,V)... which results in a very flat and unrealistic looking surface.

There are actually three cosine terms: dot(incident light dir, surface normal), dot(emitted light dir, normal), dot(viewer dir, normal) -> the last two cancel out (the differential area over which the emitted light is distributed grows proportionally to the observed differential area).

#5154316 Geometry Shader for a quad or not ?

Posted by Tasty Texel on 17 May 2014 - 01:26 PM

On my Intel HD Graphics 3000 thingy extracting quads from points is about twice as fast as instancing quads.

#5123450 CG book suggestions

Posted by Tasty Texel on 13 January 2014 - 08:37 PM

Just to throw some unmentioned stuff in: ShaderX-, GPU Pro-, GPU Gems-, Jim Blinn's Corner - series, Real-Time Shadows (really good), Visual Perception From A Computer Graphics Perspective

#5108441 Voxel Cone Tracing Experiment - Part 2 Progress

Posted by Tasty Texel on 11 November 2013 - 04:43 AM

Just a general idea regarding the light-info accumulation concept which was floating around my head for some time now and I finally want to get rid of :

Instead of cone-tracing per screen-pixel (which is how the technique works default wise IIRC), couldn't you seperate your view frustrum into cells (similar to what you do for clustered shading, but perhaps with cube-shaped cells), accumulate the light information in these represented by spherical harmonics using cone-tracing and finally use this SH - 'volume' to light your scene?

You would of course end up with low frequent information only suitable for diffuse lighting (like when using light propagation volumes, but still with less quantization since you would not (necessarily) propagate the information iteratively (or at least with fewer steps if you choose to do so to keep the trace range shorter)) but on the other hand you could probably reduce the amount of required cone-traces considerably (you also would only need to fill cells with intersecting geometry (if you choose not to propagate iteratively)) and, to some extend, resolve the correlation between the amount of traces and the output pixel count.

Just an idea.

#5104071 Spherical Area Lights

Posted by Tasty Texel on 24 October 2013 - 05:54 AM

I was plotting some values and noticed that the sin2 term looked just like the smoothstep function, and it turns out that it's coincidentally very close:

That's basically how the vegetation's wind animation in Crysis has been optimized: https://developer.nvidia.com/content/gpu-gems-3-chapter-16-vegetation-procedural-animation-and-shading-crysis

I'm always using  x * x *( 3.0 - 2.0 * x ) instead of Smoothstep, which I think is often times more optimal since Smoothstep maps the input to the range [0..1] at first even if it is already in this required range.

#5103748 Spherical Area Lights

Posted by Tasty Texel on 23 October 2013 - 09:49 AM

The formula given in the paper needs to be converted from angles to vectors before being used in shader code, and it can be rearranged quite a bit too, which is why it often looks different.
Ok, but the last time I checked GGX on being normalized I actually got 1. Have you forgotten to include the cosinus term perhaps?

#5103660 Spherical Area Lights

Posted by Tasty Texel on 23 October 2013 - 05:39 AM

Your GGX D does not appear to be right in general: http://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf

#5088901 Questions about Sampling / Reconstruction filter

Posted by Tasty Texel on 25 August 2013 - 08:53 AM

Raytracing is as much a discrete sampling task as rasterization: you trace a ray and sample discretely at the intersection point. Means when tracing a single ray per screen pixel you'll get the very same aliasing artifacts as if you had rasterized the scene.

#5087787 Radiometry and BRDFs

Posted by Tasty Texel on 21 August 2013 - 06:52 AM

The BRDF with the delta functions does have an infinite value in the direction (θ,Φ+π), and so does the radiance along that direction.

Hmmm, from my understanding it's actually the differential radiance which is infinite in this direction, which implies that we have to integrate over a set of directions to arrive at radiance itself in the first place. In the case of a pinhole camera this set of directions would be infinitesimal. As a result of this we get a finite amount of outgoing radiance for a delta function and an infinitesimal amount for the usual cases where the differential radiance is finite along all directions. That was the point where I thought that we implicitly assume infinte high sensor sensibility to compensate for that, which again would give us infinite measument results for perfect reflections which are modeled using delta functions in the BRDF, since these are the only cases which give us finite/non-infinitesimal radiance arriving at the sensor in the first place. :\

#5071909 Environment reflection & fresnel correct ?

Posted by Tasty Texel on 21 June 2013 - 06:43 PM

The probably optimal solution would be to extend the fresnel approximation in a way that it factors in the underlying microfacet distribution of the surface. I don't know if this has been done before. I think this would require some kind of convolution.

However, fixing your sub-optimal brightness ration (sun light / env light) should help a lot already. The intensity of illumination by the sun gives the impression of an overcast day  (kinda, it's not smooth but the intensity is quite low) whereas your sky is clear and bright. Try to make the env light more subtle and the sun stronger. You could also try some static tonemapping in combination with real world intensities for sun and sky (at least for prototyping purposes).

#5071873 Environment reflection & fresnel correct ?

Posted by Tasty Texel on 21 June 2013 - 02:09 PM

float3 Fresnel_env = FresnelReflectance +  (1.0f - FresnelReflectance) * pow(1.0f - NdotV, 5);

Seems right to me. However, you have to consider that due to microfacets you will not actually reach the point where you get perfect reflections since for steep angles there will be some amount of microfacet-normals pointing tendentially towards the observer. Also the direct illumination by the sun will usually be much brighter than the environmental lighting. After tonemapping the effect of your environmental illumination will be therefore further diminished.

#5071730 Question about Irradiance Environment Maps

Posted by Tasty Texel on 21 June 2013 - 02:36 AM

I think it's a good idea in general to do step #2 on the GPU, even for pre-computation.

#5071102 "Soft" shader, or, how do I get this skin-lighting effect?

Posted by Tasty Texel on 19 June 2013 - 06:34 AM

Quite some time ago I wrote such a NPR-shader on request for a fan game:


(Yoshi's design is copyrighted by Nintendo, of course. The model itself was made by a user called Otter over on the GameStudio forums)


It's really just the sum of various effects put together: pure rim lighting, velvet shading (once blended over the underlying albedo color and once multiplied with it), wrap diffuse lighting, blinn-phong + minnaert spec highlights, spherical harmonics for some fake ambient lighting (sampled with a reflection vector to make it a bit more high-freq) and probably some other artistic tricks. But to be honest, when watched directly from the primary light's perspective the shading was quite flat. However, there is a lot of potential for nice artistic NPR-styles. You probably have to find the one which fits best for your situation iteratively, as usual. smile.png

#5060284 Radiance (radiometry) clarification

Posted by Tasty Texel on 08 May 2013 - 07:27 AM

You can not both understand Lambertian reflectance *and* disagree with my point

There are no physical surfaces for which the emitted flux doesn't fall off to zero at grazing angles. A non-lambertian surfaces simply doesn't emit it's flux distributed in the way of the idealised cosinus lobe. Otherwise the radiance would indeed tend to infinity at grazing angles. The sheer physically implausibility of this idea implies the first statement.

#5059244 Pros and Cons with Specular and Diffuse lighting

Posted by Tasty Texel on 04 May 2013 - 01:09 PM

One pro for diffuse lighting is that you can pre-compute complex (indirect) lighting for static scenes since it's not viewing direction dependend as long as you stick with Lambert which is sufficient in the most cases.