With the (new) instancing feature, is it (easily) possible to “draw” custom text as a label next to each geometry instance?
You’d draw your geo using instancing, and have a rectangle parented to the geo (and also draw using instancing so it followes the geo around (for the text to go on).
Then using a GLSL shader you’d need to select the correct texture for the rectangle (which has the text). You could use the new 2D Texture Array feature in TOPs to setup all of your labels, and select whichever one you wanted based on the instance id.
neat! How’s that 2D Texture Array feature gonna work? I currently have all labels in “groups” of DATs. So each DAT holds all the labels that at one point in time need to be displayed. Will I be able to use this? Maybe even by supplying the text TOP with a table, which then creates an array slice foreach row in that DAT. Wishful thinking?
A 2D Texture Array is almost the same as a 3D Texture, except it sampled using unnormalized w coordinates (0 for the first slice, 1 for the 2nd slice etc.). And it doesn’t support blending between different slices like 3d textures (which means it a lot faster). You sample it in GLSL using texture2DArray(sampler2DArray, vec3)
Using the pre-fill feature in the 3d texture TOP you’ll be able to setup your array from a table.
i see, working fine (except for the weird half frame offset in tex3d …).
So the texture2DArray() function can target a texture 3d TOP? Or was this just an example and there will be a texture 2d TOP with pre-fill feature?
Finally, can you already say when the next experimental build will be posted?
The Texture 3D TOP can create either a 3D Texture, or a 2D Texture Array (there is a menu in the new build). They are so similar I didn’t want to make a 2nd TOP.
So depending on what you create, you use texture3D or texture2DArray to sample it.
The half frame offset is a property of textures in general. If you sample a 2d texture at coordinate u=0, you’ll get 50% left most texel and 50% of the rightmost texel (assuming you have extend mode repeat on). If you want to get 100% of a texel, you need to have a coordinate thats 1/2 a texel offset from the edge of the texel.
Not sure when the next experimental will be posted, we’re getting there.
weird, but probably has a good reason. thx for the explanation. I think jarrett also hinted at an “easyfication” so that w = 0 is actually the first and w = 1 the last image of the 3d texture.
Ya if you think about it it makes sense when it comes down to rendering and texturing a polygon (this is all what OpenGL does btw). It’s just not intuitive, but if you’re doing something like the Time Machine TOP, you want it to behave this way.
I don’t see how you could simplify this. In texture coordinates, 0 and 1 are the same thing (assuming extend mode is repeat again). Moreover if I was to make 0 be the first slice, then how would you get a blend between the first and the last slice (currently at w=0 you’ll get that blend).
2d texture arrays are the easyfication of this.
In terms of simplification, I was originally thinking that touch could do the necessary math (like in “/project1/geo1/math2” in jarrett’s example) automatically (and optionally). But as the texture 2d doesn’t suffer from this, all good
Actually I got another question regarding instancing. My goal is to create a custom network editor. I have two approaches
A: use panel comps (and their reposition feature) as nodes and render actual geometry to get the wire connections
B: use real geometry (instances) as nodes and render it in one go with the wire connections. I’d store each node’s position in a table and use renderpick to do stuff like reposition/rollovers/…
From your experience, if you can estimate at all, what do you think would be the more efficient approach?
Well any simplification for texture 3d would break the math for other uses. Imagine you wanted to texture a rectangle using a ‘lengthwise’ slice of the texture 3d (single slice starting at the front of the 3d texture and ending at the back). If I was the fudge the coordinate automatically, it wouldn’t be possible to do the above example correctly without un-fudging the coordinate in a custom GLSL shader.
If you want to reference slices exactly, this is what the 2d texture array is for. Jarrett’s example is why I added the 2d texture array infact.
I assume B would be the faster approach when it comes to GPU usage.
thanks for all this info. Gonna try option B