Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6966887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:14:59+00:00 2026-05-27T16:14:59+00:00

Using shader model 5/D3D11/HLSL. I’d like to treat a 2D array of texels as

  • 0

Using shader model 5/D3D11/HLSL.

I’d like to treat a 2D array of texels as a 2D matrix of Vectors.

      u
v (1,4,3,9)   (7, 5.5, 4.9, 2.1)

(Each texel is a 4-component vector). I need to access specific ranges of the data in the texture, for different shaders. So, the ranges to access in the texture naturally should be indexed as u,v components.

How would I do that in HLSL? I’m thinking the following:

  • Create the texture as per normal
  • Load your vector values into the texture (1 vector per texel)
  • Turn off all linear interpolation for texture sampling (“nearest neighbour”)
  • In the shader, look up vectors you need using texture coordinates

The only thing I feel is shaky is whether there will be strange errors introduced when I index the texture using floating point u’s and v’s.

If the texture is 1024×1024 texels, and I’m trying to index (3,2)->(3,7), that would be u=(3/1024,2/1024)->(3/1024,7/1024) which feels a bit shaky. Is there a way to index the texture by int components, perhaps? Or will it just work out fine?

Texture2DArray

Not desiring to use a GPGPU framework just for this (so no CUDA suggestions pls :).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:14:59+00:00Added an answer on May 27, 2026 at 4:14 pm

    You can do it using operator[] in hlsl 5.0

    See here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When compiling the following for loop in my HLSL shader under Shader Model 2.0,
I'm using SlimDX, targeting DirectX 11 with shader model 4. I have a pixel
For what purposes are we using Model View Projection Matrix? Why do shaders require
I'm writting a small graphics program using directx9 which imports some model files created
I need to make a linear programming model. Here are the inequalities I'm using
I'm implementing an algorithm about pencil rendering. First, I should render the model using
I would like to render an animated voxel scene using WebGL and Three.js, for
how do you enable compatibility mode in HLSL? I'm using Visual studio and xna.
I'm using various 'nested' contexts in my application (for shader and geometry sharing), so
How can I draw an arc using a Shader such as SweepGradient? The examples

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.