xna-4.0


What does the pixel shader function tex1D do with a Texture2d


If I call tex1d from my pixel shader on a texture that has been initialized as a texture2d will it treat the data as a one dimensional array and then just take the element at whichever position you specify?
For instance if you have a 10 x 10 texture(that would be a one dimensional array 100 elements in length) and you call tex1d(mySampler, 0.95) will it give you back element 95?
I think you will find this quote (regarding DirectX 9, which is what XNA is built on) relevant:
Because the runtime does not support 1D textures, the compiler will use a 2D texture with the knowledge that the y-coordinate is unimportant. Since tex1D(s, t) (DirectX HLSL) is implemented as a 2D texture lookup, the compiler is free to choose the y-component in an efficient manner.
In other words: you specify the X coordinate, and the Y coordinate is undefined.
From here.
So, no, it won't unwrap the indices. But you already got an answer about how to do that.

Related Links

How to set xna's TextureFilter to Point
Why doesnt my xna pixel shader turn this texture blue?
How to calibrate kinect skeleton data to video feed?
XNA game studio4.0 using c#
How to add collision detection in a 2D car game in XNA?
Texturing a terrain causes Windows Phone to crash (without an exception) or Models are not drawn afterwards
compiling and deploy window mobile phone platform games into xbox360 game platform with XNA 4.0
'Expected class, delegate, enum, interface,or struct' in XNA 4.0?
Having errors running JigLibX 0.3.1 on XNA 4.0
How to remove splash screen?
Layouting a row of bricks on the wall in XNA 4
Xbox 360 XNA HLS Streaming
XNA Reach profile
Stencil testing in XNA 4
What game engines are available for XNA 4.0?
Windows Phone 7 / XNA 4 - Texture Blur effect

Categories

HOME
sendgrid
log4j
hook
pypi
server
layout
iot
fme
cplex
alfresco
framework7
sqlite-net-extensions
react-redux
electronics
ip
wamp
in-app-purchase
contact
adfs
metatrader4
ssl-client-authentication
dax
numeral.js
moonmail
remote-access
try-catch
caml
database-replication
jqwidget
conemu
orleans
tapestry
sparse-matrix
underflow
virtualdub
uninstall
kendo-datasource
create-table
catch-all
lxd
scaffold
dynamics-crm-2013
vapor
unoconv
android-tabhost
sfdc
fedex
pdf-reactor
elmah
jvm-languages
bootstrap-dialog
errordocument
jxcore
carrot
feeds
google-perftools
nsarray
media-player
windows-mobile-6.5
ifs
qtwebview
flow-control
arrow-keys
nbconvert
redundancy
root-framework
time-and-attendance
fody
django-debug-toolbar
dlna
livequery
tform
revolution-r
xpath-1.0
cloudbees
jfugue
purge
libressl
rgeo
web-controls
unity5.2.3
jsapi
dd
qpainter
coldbox
client-side-templating
xojo
p4java
jplaton
buster.js
type-equivalence
itmstransporter
bitsharp
spring-portlet-mvc
rfc1123
gdlib
asp.net-profiles
xetex
yagni
phonon
noscript
ubuntu-9.04
rtml
caching-application-block

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App