Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 20 Oct 2006
Offline Last Active Apr 14 2016 03:26 PM

Topics I've Started

Texture sample as uniform array index.

02 April 2016 - 07:55 PM


So I'm trying to implement a material compositing system using Texture2DArrays and vector arrays indexed by a sample from a mask texture. 



1.) Is it even possible to use a texture sample as an index into a uniform array?

2.) If it is, is there a huge performance hit?



How to calculate Lumens?

14 May 2015 - 07:31 PM

I've seen the term being thrown around a lot lately when I read up on engines with their new PBR pipelines. Quite a few of them are saying that they now specify their light intensities in Lumens. I know that that is a term referring to output from real-world light source, but that's the extent of my knowledge. 


My questions are:

1.) How do they pertain to lights in shaders?

2.) Is there a specific formula for calculating the light intensity from them?

3.) Am I just over-thinking this, and Lumens is just another name for the light intensity scale value?


Any help would be most appreciated. Thank you.

[SOLVED] Detail mapping + Parallax = Texture Swimming?

31 December 2014 - 09:00 PM

So basically when I do heavily tiled detail mapping on a surface that is using Offset Bump Mapping or Parallax Occlusion Mapping, as I orbit around the surface the detail maps appear to swim across the surface.



  1. Both the base and detail maps use UV0.
  2. The base maps are tiled 1x with no offset.
  3. The detail maps are tiled 10x with no offset.
  4. The parallax offset is generated from a heightmap tied to the base maps texture coordinates.
  5. I apply the parallax offset like so: (UV0 * Tile + Offset) + parallaxOffset.



  1. Is there any way to counteract this problem?
  2. Do I need to modify the parallaxOffset somehow before I apply it to the transformed detail texture coordinates?
  3. Are Detail mapping and Parallax just inherently incompatible?


[SOLVED] Area Light, Representative Point, Blinn-Phong

26 August 2014 - 08:10 PM


Okay, so I have seen Epic's paper that covers, among other things, how they did area lights in UE4 by the "representative point" method:



They specifically talk about how they needed to come up with a modification to the normalization factor for their BRDF to make the intensity looks close to correct. However, the one they list is for GGX, and I am using Normalized Blinn Phong. Sadly, I don't understand the math behind normalization.



Is there a nice simple way for me to find the normalization factor to use Normalized Blinn Phong with this area light trick?



Toksvig AA and normal map precision issues

23 January 2014 - 08:23 PM


I am working on a physically based shading system in Unity. Among the many components needed by this system is way to compensate for specular aliasing. Our chosen method involves calculating Toksvig AA from our normal maps, pre-correcting our specular powers, and storing the result for use at runtime.



We are dealing with ARGB32 precision normal maps as inputs, and are encountering the problem that some of our artists tools don't quite output unit length normals in this precision. Unfortunately, this has dramatic consequences when applied to our pre-correction of specular powers, even for "flat" normals. So materials that are supposed to be smooth end up getting dramatically more rough.



1.) Is there a way to deal with this besides just using higher precision storage for our normal maps? 

2.) One of our tactics to try to deal with this problem is offering the artist a bias factor that adjusts the calculated variance down slightly to compensate. Is this a valid solution, or will it break horribly down the line?

3.) Is there some other trick I could try that I have overlooked?


Thanks for any help you can provide.