Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualeppo

Posted 21 January 2013 - 10:06 AM

How about you recreate the entire texture as a lookup table in the pixel shader and then sample it like this: out.color = colors[round(texCoords.x * 11)]?

const float3 colors[] = {

   float3(0.f, 0.f, .5f),
   float3(0.f, .23f, .73f),
   float3(0.f, .45f, .95f),
   float3(0.f, .68f, 1.f),

   float3(0.f, .9f, 1.f),
   float3(0.f, 1.f, .73f),
   float3(0.f, 1.f, .27f),
   float3(.23f, 1.f, 0.f),

   float3(.63f, 1.f, 0.f),
   float3(1.f, .91f, 0.f),
   float3(1.f, .45f, 0.f),
   float3(.93f, .11f, .14f),
}

#1eppo

Posted 21 January 2013 - 10:06 AM

How about you recreate the entire texture as a lookup table in the pixel shader and then sample it like this: out.color = colors[round(texCoords.x * 11)]?

 

 


const float3 colors[] = {
   
   float3(0.f, 0.f, .5f),
   float3(0.f, .23f, .73f),
   float3(0.f, .45f, .95f),
   float3(0.f, .68f, 1.f),
 
   float3(0.f, .9f, 1.f),
   float3(0.f, 1.f, .73f),
   float3(0.f, 1.f, .27f),
   float3(.23f, 1.f, 0.f),
 
   float3(.63f, 1.f, 0.f),
   float3(1.f, .91f, 0.f),
   float3(1.f, .45f, 0.f),
   float3(.93f, .11f, .14f),
}

PARTNERS