Transfroming objects in a shader

I would appreciative some help on transforming several objects in one shader.

please have a look at the attached patch.

Would be very kind if someone with some HLSL knowlege coul help me out.

thanks
andreas

Origami Forms.zip (5.0 kB)

what you need here is a technique i mentioned elsewhere already: geometry instancing. i will document this technique after the beta21 release which will make it even more easier to use by allowing arrays of transformations being put into an effect…

for now…
from your patch:
“Maybe the it would be smart to center the generated Objects to a 0|0 Point?!”
yes, like this it will be easier to control the position of all your blobs.

your use of the texturecoordinate for the instanceindex is basically correct, but seems to have a problem. your mesh has 55 vertices, but the mesh indices only count up to 10…i dont get how the indexing is supposed to look…

in the patch:
for now you have to use a getmatrix node to put the transformations to the effect as values.

in the shader:
define a float4 array of transforms (that gets the values from getmatrix)…then always take 4 of those transforms to create a float4x4 world transformation for each instance. using the instance index coming in via the texturecoordinate to access the tranformations array…

so that is the basic idea, but i admit it may sound a bit complicated if you’re not into shaders… it will be much clearer with beta21 and a clean sample.

“irgendwann ist immer das erste mal” (sorry to lazy to translate .)

somehow i will reach the goal (hopefully - hehe)!

hmm, are there some examples available? the superformula shader does transformations inside the shader right? ah, another question: how to iterate over a array, is ther something like tIn.lenght. another one: how to debug, something like System.prinLn() ??? maybe its better to google for all my questions tahn spamming the forum ;)

puh,

I still can’t get my head round how that stuff works. think I have to read first a lot tutorials ;)

maybe anybody can help out as I don’t have the time to reak a lot of stuff first. Hmm, don’t knwo, what can I offer - maybe my php coding skills, maybe somebody needs a new portfolio … having fun in doing portfolios with indexhibit latley.

  • hmm, are there some examples available?
    there are on the net. look for geometry instancing, but as i said, it is a little tricky to understand and i will be providing an example…soon

  • the superformula shader does transformations inside the shader right?
    many shaders do that. what you want is special: translate blobs of vertices of one mesh individually that are not subsets. usually this is used for performance-reasons. but your case also does seem to be a valid one (if you get the indexing of your blobs right…)

  • how to iterate over a array, is ther something like tIn.lenght.
    you are supposed to take the blob/instance-index for this that comes in via the texturecoordinate!

  • how to debug, something like System.prinLn()
    the only way to debug shaders with vvvv is to write values out the pixelshader as colors and interpret them visually or using pipet.

  • I still can’t get my head round how that stuff works.
    indeed geometry instancing is a rather advanced topic, so you should probably rather start with more simple stuff…

thanks for the statement joreg. I understand the theory behind the approach but my problem is that I don’t know where to start because of my lack of knowledge about hlsl.

wish a nice weekend.

maybe some other guys here have time to help out - a new portfolio is waiting for you ;)

found this tutorial here. maybe someone could translate a little for me (especally Example 3-5).

greetings andreas

seems everybody is bussy :(

I’m pretty sure that’s just a piece of cake for most “shader guys” here. As I’m a bit short of time with this project I would pay for that modification - just make some announces.

Greetz Andreas