Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 29 Jul 2010
Offline Last Active May 29 2013 01:29 AM

Topics I've Started

Bumpy grass on terrain

22 May 2013 - 07:31 AM


I am trying to make my flat terrain a little bumpy and I saw Outerra's old implementation.



It looks pretty well but I couldn't figure it out. It seem POM is used but I tried lots of combinations with POM and normal mapping and I couldn't achieve that sight.


Do you have any idea about how to achieve such a perfect bumps on grass.

A8_UNORM Texture sampling problem

28 April 2012 - 04:48 AM

Hi. I have a texture with format A8_UNORM. When i try to sample it in pixel shader it was returning just zero.But when i changed my shader variable from
Texture2D<float> sth
Texture2D<float4> sth
and in shader, sampled the alpha component instead of the red component (sth.Sample(...).a instead of sth.Sample(...).r) it worked well.I am really confused with this situation. Although my texture has single channel,i am able to sample it with Texture2d<float4>.Can someone please enlighten me?

Normal packing problem with spheremap transform

03 April 2012 - 12:48 PM

Hi. I am trying to pack my view space normals into two float with spheremap transformation. Actually i can pack and unpack them well but, while packing specific vectors - (0,0,1) and (0,0,-1) - , the algorithm is trying to call normalize(0,0). So this is causing a infinite result. Is there any way to solve this without placing some if statements into packing and unpacking functions ? I am using functions from here.

Texture2D load problem in CS

16 March 2012 - 10:08 AM

Hi. I am trying to implement deferred shading technique.I am encoding my normals into a render target in pixel shader.Then i am bounding shader resource view of this resource to the compute shader.In PIX, i can see that the surface is bounded to CS so everything works fine but when i try to sample any normal data it just returns "0". Here is my simple code but it doesn't work.As you can guess it is just filling surface with blue.
#define TILE_SIZE 16
RWTexture2D<float4> gOutTexture  : register(u0);
Texture2D<float2> gInputTexture  : register(t0);
void DeferredShadingCS(uint3 groupId   : SV_GroupID,
						 uint3 dispatchThreadId : SV_DispatchThreadID,
						 uint3 groupThreadId : SV_GroupThreadID
float2 data = gInputTexture.Load(uint3(dispatchThreadId.xy,0));
gOutTexture[dispatchThreadId.xy] = float4(data,1,1);

RWTexture2D problem with half4

15 March 2012 - 07:14 PM

Hi.I can't compile following code.Compiler says "typed UAV stores must write all declared components.".But when I use float4 instead of half4 it works well.
What does that error mean? Posted Image

RWTexture2D<half4> gTexture : register(u0);

void CS(uint3 groupId   : SV_GroupID,
						 uint3 dispatchThreadId : SV_DispatchThreadID,
						 uint3 groupThreadId : SV_GroupThreadID
gTexture[dispatchThreadId.xy] = half4(1,1,1,1);