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

XNA changing 200 or so tiles pixels
Loading files during run time in XNA 4.0
Optimized keyboard controls for XNA game
Best structure for xna Arcade Game
xna 4 taking desktop screenshot
Can't reset my gametime to zero in XNA
Displaying seconds in XNA with Keypress?
XNA game how to make a snake tail
Creating an array of game objects
Lap timer in XNA 4.0?
XNA: Identifying identical sprites created with for loop
Increase Character Spacing in XNA
XNA choosing a subgroup of Game.Components
Loading Silverlight Texture2D from Resources
XNA Game - Open a Popup or a Custom Game Screen before launching a game
'Microsoft.Xna.Framework.Vector2' is a 'type' but is used like a variable?

Categories

HOME
maven
ms-access
ibm-bluemix
log4j
client
wso2
netbeans
minimum-spanning-tree
google-api-php-client
nullpointerexception
relay
grep
read-eval-print-loop
rsyslog
framework7
ip
cross-browser
adfs
google-cloud-spanner
orchardcms
fallback
zebra-printers
circuit
quartz-scheduler
netflix
django-admin
database-replication
evopdf
text-rendering
jasonette
excel-2007
extjs5
mmap
p-value
centos6.5
apache-commons-io
gitignore
madlib
.net-4.0
vsts-build-task
hybridauth
avcapturesession
rotational-matrices
html5-fullscreen
x11-forwarding
gesture
ssjs
elasticsearch-plugin
firebase-admin
isbn
heightmap
total-commander
qcombobox
galleria
paxos
python-webbrowser
tactic
lift-json
font-size
capacity
zendesk-app
gnome-shell-extensions
migradoc
messenger
word-vba-mac
visual-c++-2008
vmware-tools
bonobo
contact-list
captivenetwork
bluemix-app-scan
nessus
php-parse-error
xpath-1.0
associative-array
pyke
kendonumerictextbox
jms2
coveralls
myo
composite
kineticjs
qpainter
winddk
client-side-templating
websocket4net
issuu
internet-connection
html-helper
googlemock
uitouch
funcunit
system.net.webexception
bundles
balanced-payments
page-layout
ccss
commoncrypto
inbox
file-locking
mylyn
yui-compressor
random-seed
spring-validator
lcs
drools-planner
cisco-jtapi
newtonscript
doh
tomcat-valve
subviews
gamma
gin
vc90
ncqrs
firefox4
avatar
premature-optimization
mdac

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App