xna-4.0


Is there a Texture1D in XNA?


I need to pass an array of Vector3 or Vector4's to my pixel shader. Is there something like a one dimensional texture that I can set from the CPU and sample on the GPU?
No there is no built-in class that you can use, but you can create your own one (untested):
public class Texture1D
{
GraphicsDevice device;
Vector4[] pixels;
bool mipMap = false;
SurfaceFormat Format;
public Texture1D (GraphicsDevice Device, int Length)
{
pixels = new Vector4[Length];
device = Device;
Format = SurfaceFormat.Color;
}
public Texture1D (GraphicsDevice Device, int Length, bool mipMap, SurfaceFormat format)
{
pixels = new Vector4[Length];
device = Device;
this.mipMap = mipMap;
Format = format;
}
}

Related Links

XNA Vector2 path contained inside rectangle
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

Categories

HOME
ibm-bluemix
testing
variables
blogger
mediawiki
drivers
mfc
stock
electron
bookshelf.js
razor
paw-app
google-project-tango
flyway4
onelogin
android-youtube-api
amazon-cloudformation
session-variables
maude-system
zebra-printers
dynamics-crm-online
apache-metamodel
pythonanywhere
java-3d
opencover
errorlevel
csrf-protection
extjs5
realex-payments-api
zurb-foundation-6
cultureinfo
angular2-aot
microsoft-sync-framework
buildbot
kannel
phpfox
replaceall
jspm
libuv
bpel
nat
bosh
mapbox-gl
catalog
restlet
adobe-premiere
retina-display
ruby-on-rails-3.1
wptoolkit
logfiles
taffy
apache-fop
snmptrapd
dtexec
python-cryptography
mako
iso8601
mediaelement
messenger
ableton-live
vmware-tools
login-control
skobbler-maps
merge-conflict-resolution
paypal-express
autorest
prettytensor
whois
hexdump
itextpdf
wso2cloud
atk4
rgeo
riak-cs
service-accounts
appfabric-cache
sonarqube5.1.2
npapi
kineticjs
camanjs
google-style-guide
relocation
flask-cors
datagridviewcolumn
mysqltuner
xsockets.net
inbox
odata4j
django-nonrel
chronoforms
free-variable
broken-links
runas
hosts-file
objective-c-2.0
nsdatecomponents
gnustep
qt-jambi
xmlspy
xmemcached
table-footer
mtj
pascal-fc
text-coloring
defensive-programming
django-notification
document-conversion

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