Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Oct 2003
Offline Last Active Aug 15 2012 09:45 PM

Topics I've Started

iOS geometry shader support

15 August 2012 - 09:18 PM

Does it exist? I've did a few searches on google but didnt find anything useful. Is there an extension available such as EXT_geometry_shader4?


3D LUT Color Correction issue

26 July 2012 - 09:19 PM

So I decided to try to implement color correction using 3D lookup tables based on the article found here: http://http.develope..._chapter24.html

I then used the "color neutral" texture found on the UDN here: http://udn.epicgames...lorGrading.html

I made sure to convert the color neautral texture from 2D to 3D, so 256x16 => 16x16x16.

Here is my shader code for sampling the texture:

[source lang="cpp"]half4 outColor;half4 inColor = tex2D(colorMap, inUV);half3 lutSize = half3(16.0h, 16.0h, 16.h);half3 scale = (lutSize - 1.0h) / lutSize;half3 offset = 1.0h / (2.0h * lutSize);outColor.rgb = tex3D(LUTSampler, scale * inColor.rgb + offset);outColor.a = 1.0h;return outColor;[/source]
My results are totally weird, for example everything is either bright green and pink. I am assuming either the "color neutral" texture I am using from Epic's website isnt neatral OR I am doing something wrong. If my code is correct does anyone know how I could generate a color neutral 3D lut?

Also, I converted the 2D image to 3D by writing a little tool that would write each 16 wide section of the original texture into a new slice of the volume texture. I checked each slice manually in the d3d texture tool and it was correct. I thought maybe the slice order was wrong but that didnt change anything except make it all red and black instead of pink and green. It's almost as if it only samples from the bottom slice...

I've attached a screen shot, ignore the vignette...


Irradiance map issues

25 March 2012 - 05:13 PM

I am experimenting with irradiance maps for use in ambient diffuse lighting. I've encountered an issue where when I sample the cube map I get weird banding and harsh falloffs. When I move an object around that is using an irradiance map its extremely noticeable. Anyone have any ideas as to what the issue could be? My shader is very simple:

float4 ambientDiffuse = texCUBE(irradianceCubeMap, worldSpaceNormal) * DiffuseTexture;
return ambientDiffuse;

This is what I see as a result

Posted Image

You'll notice it moves from dark to light very abruptly and it looks terrible when in motion. I've tested with multiple cube maps but I always see the same thing.

Thanks for any help

Way to do Light Beams/Rays of Light (Non-defferred)

23 September 2010 - 07:22 AM

Basically I am looking for a good way to simulate light beams or rays of light. I say "non-deferred" because the light beams do not have to interact with the scene they just need to look like rays of light so a z-prepass seems unnecessary. People have been doing this for years not sure why I am having a hard time o.O

Anyone have a good technique for doing this?

My first approach was to do reverse rim lighting on a cone with a falloff like this:

// I assume that the local origin of the object is 0, 0, 0
float transparency = 1 - saturate(length(In.localPosition) / Falloff);
float3 V = normalize(In.eyeVec);
float3 Nn = normalize(In.worldNormal);

float rim = pow(dot(Nn, V), RimPower) * transparency * RimColor.a * RimIntensity;

return float4(RimColor.rgb, rim);

This looks good only when the surface normals are facing the camera...

Direct3D texture sampling comparison modes

30 March 2010 - 12:23 PM

Hi I am trying to implement a self shadowing technique in D3D that I already have working in OpenGL and I am confused about one thing. In OpenGL I can set the comparison mode of a texture (using GL_TEXTURE_COMPARE_MODE) meaning I can sample the texture and use that value as a reference in a comparison (getting a value of 0 or 1) rather then sampling like a normal texture. I am fairly new to D3D and couldn't figure out how to do this via the documentation. Any help is appreciated.