- Forums
- Forum Help
- Search Forum
- Login
- Register
Truevision3D
>>
TV3D SDK
>>
TV3D SDK 6.5
>>
Shader Development
>>
Minimesh Shader
Pages: [
1
]
« previous
next »
Print
Author
Topic: Minimesh Shader (Read 641 times)
serial
Customers
Community Member
Posts: 299
Minimesh Shader
«
on:
February 15, 2008, 11:11:34 PM »
Would it be possible to use a texture image source for positioning minimeshes instead of an array? I'm getting better at the pixel shaders but the vertex shaders are still beyond me at this point.
I thought I read some where you can use a texture sampler in a vertex shader but I can't find it again.
Logged
newborn
Customers
Community Member
Posts: 2416
Re: Minimesh Shader
«
Reply #1 on:
February 16, 2008, 09:28:58 AM »
this has nothing to do with shaders (unless I did not understand your question properly)
texture.lock(iTexture)
for x = 0 to iTextureWidth step fPrecision
for y = 0 to iTextureHeight step fPrecision
if texture.getpixel(x, y) = white then
iMinimesh += 1
minimesh.setposition(iMinimesh, x, landscape.getheight(x, y), y)
end if
next
next
texture.unlock(iTexture)
fprecision is the distance between your minimesh
Logged
serial
Customers
Community Member
Posts: 299
Re: Minimesh Shader
«
Reply #2 on:
February 16, 2008, 01:09:58 PM »
Sort of, I want to be able to do that inside of a shader though.
Logged
Zaknafein
Customers
Community Member
Posts: 2588
Re: Minimesh Shader
«
Reply #3 on:
February 16, 2008, 07:36:36 PM »
Vertex texture sampling is only available with vs_3_0 and more, so pretty recent cards. If you're planning a public release, it's not a very viable solution.
But yes, it's possible and can be used for moving instances around. It's the same functions as you'd use in a vertex shader (tex2D) but instead of using it as a colour, you can use it as a modifier to the position of your current vertex. If all vertices inside an instance share the same modifier, then the whole instance has moved.
Logged
zaknafein.
>>
the instruction limit
: my blog & samples repository! <<
Waterman
Customers
Community Member
Posts: 1141
Re: Minimesh Shader
«
Reply #4 on:
February 18, 2008, 05:34:50 AM »
Is there something that uniquely identifies an instance of the minimesh when it's drawn? (For and in the vs)
I'd be interested in hearnig the technique for this...
Logged
Things should be described as simply as possible - but not simpler [A. Einstein]
JukkaKevät
Customers
Community Member
Posts: 182
Re: Minimesh Shader
«
Reply #5 on:
February 18, 2008, 10:10:21 AM »
Check out the Million Particle System, it handles particle systems entirely in GPU.
http://www.2ld.de/gdc2004/
edit:
Also something which can be useful...
http://developer.nvidia.com/object/using_vertex_textures.html
«
Last Edit: February 18, 2008, 10:13:30 AM by JukkaKevät
»
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Truevision3D Official Information
-----------------------------
=> News and Announcements
=> Development Information
-----------------------------
TV3D SDK
-----------------------------
=> TV3D SDK 6.3
===> Bugs
=> TV3D SDK 6.5
===> Bugs
===> Content Pipeline
===> Shader Development
-----------------------------
Projects
-----------------------------
=> Announcements
=> In-Development
=> Showcase
=> Recruitment
-----------------------------
Game Development
-----------------------------
=> Engine Comparison
=> Game Development
=> Companion Tools
=> Design and Theory
Powered by SMF 1.1.3
|
SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks