Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#Actualn3Xus

Posted 04 June 2014 - 09:36 AM

If I understand correctly... :

 

Your 1D texture has 4 components (4d vector). ( desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; -> R,G,B,A)

If you sample at location 0 it will read the 4D vector. That 4d seems to be (1,0,1,0) (R and G are 1).

RGB components are not separated, they are combined.

 

So when you mixed them you get purple.

 

You need sampleLevel(sampler,0,....).x to get red.

 

SampleLevel should be used if you need a specific mip-map, it has nothing to do with RGB channels.

 

EDIT: you should use the default sample function, not sampleLevel if you don't need mip-maps.


#4n3Xus

Posted 04 June 2014 - 08:20 AM

If I understand correctly... :

 

Your 1D texture has 4 components (4d vector). ( desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; -> R,G,B,A)

If you sample at location 0 it will read the 4D vector. That 4d seems to be (1,0,1,0) (R and G are 1).

RGB components are not separated, they are combined.

 

So when you mixed them you get purple.

 

You need sampleLevel(sampler,0,....).x to get red.

 

SampleLevel should be used if you need a specific mip-map, it has nothing to do with RGB channels.


#3n3Xus

Posted 04 June 2014 - 08:19 AM

If I understand correctly... :

 

Your 1D texture has 4 components (4d vector). ( desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; -> R,G,B,A)

If you sample at location 0 it will read the 4D vector. That 4d seems to be (1,0,1,0) (R and G are 1).

RGB components are not separated, they are combined.

 

So when you mixed them you get purple.

 

You need sampleLevel(sampler,0,....).x to get red.

 

SampleLevel is if you need a specific mip-map, it has nothing to do with RGB channels.


#2n3Xus

Posted 04 June 2014 - 08:19 AM

If I understand correctly... :

 

Your 1D texture has 4 components (4d vector). ( desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; -> R,G,B,A)

If you sample at location 0 it will read the 4D vector. That 4d seems to be (1,0,1,0) (R and G are 1).

RGB components are not separated, they are combined.

 

So when you mixed them you get purple.

 

You need sampleLevel(sampler,0,....).x to get red.

 

SampleLevel if if you need a specific mip-map, it has nothing to do with RGB channels.


#1n3Xus

Posted 04 June 2014 - 08:19 AM

If I understand correctly... :

 

Your 1D texture has 4 components (4d vector). ( desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; -> R,G,B,A)

If you sample at location 0 it will read the 4D vector. That 4d seems to be (1,0,1,0) (R and G are 1).

RGB components are not separated, they are combined.

 

So when you mixed them you get purple.

 

You need sampleLevel(sampler,0,....).x to get red.

 

SampleLevel if if you need a specific mip-map, it has nothing to do with RGB channels.


PARTNERS