Author Topic: Stupid Filtering - Solved  (Read 1066 times)

0 Members and 1 Guest are viewing this topic.

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
Stupid Filtering - Solved
Result:


Shader:
Code: [Select]
float strength = 1.29878f;
float offset = 0.15534f;
float height = 2.43380f;
float move = 0.0f;

texture g_tile;

//sampler s0 : register(s0);
sampler s0 = sampler_state
{
    Texture = <g_tile>;
MipFilter = LINEAR;
    MinFilter = LINEAR;
    MagFilter = LINEAR;
};

float4 ps_main(float2 texCoord  : TEXCOORD0) : COLOR
{
   float x = texCoord.x-0.5f;
   float y = strength/(texCoord.y+offset);
   float ymod = strength/texCoord.y;
   x = x/height;
   
   float2 ncoord = float2((x*ymod)+move, y);
   return tex2D(s0, ncoord);
}

technique ground
{
   pass single
   {
      PixelShader = compile ps_2_0 ps_main();
   }
}

Execution Code:
Code: [Select]
  if(!effect) return; //later we'll put in some placeholder image, but for now just fail

  _sblock->Apply(); 
  SETEFFECTPARAM("move", COP(cDirectX)->getCamera()->x/_xreduct);
 
  UINT iPassCount;
  //effect->Begin(&iPassCount,D3DXFX_DONOTSAVESAMPLERSTATE);
  effect->Begin(&iPassCount,0);

    COP(cDirectX)->getDevice()->SetRenderTarget(0, rendersurface);
    //COP(cDirectX)->getDevice()->SetTexture(0, _bgtex->tex);
    effect->BeginPass(0);
    COP(cDirectX)->DrawFullScreenQuad(0.0f,0.0f,1.0f,1.0f);
    effect->EndPass();

  effect->End();
  COP(cDirectX)->getDevice()->SetRenderTarget(0, COP(cDirectX)->_curframe); //reset our rendertarget

WHY IS THIS NOT WORKING?!

(i'm also posting this on gamedev.net since they know more about this stuff)
« Last Edit: February 16, 2009, 06:22:43 pm by blackhole »

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
Ok, generating mipmaps for my images would be a good idea...

solved.