3 ms·
How do you even create an object without any vertex data? The texture has to be stretched over something. Is this something just the center point of the object?
by rhn_mk1 4y ago
How do you even create an object without any vertex data? The texture has to be stretched over something. Is this something just the center point of the object?
- tskool3 4y ago[dead]
- mewse 4y agoYou can put anything in a texture these days; they're just generic pod arrays now and you can do pretty much whatever you want with them; they definitely aren't always images that get stretched over explicit meshes! In my game, for example, I have one texture which contains the xyz positions and rgb colors of lights. And another which contains connectivity data for a road network. Neither one is an image that gets displayed or stretched over things, but they're used as data within various shaders. The most "pure" way to do a "no mesh" render would probably be to use geometry shaders to emit your geometric primitives. (You do need to give it at least one "starting" primitive to make the draw call, but you're free to entirely ignore that primitive). It'd be trivial to embed some mesh data into a "texture", for example, just by reading vertex xyz positions into the rgb channels of a 1D texture that's `number_of_triangles*3` elements wide, and your geometry shader could walk along that texture and output those vertices and triangles and have them get rendered, without ever accessing a vertex buffer object.
- user3939382 4y agoWow this has advanced a lot. I'm a programmer but in a totally different space. The last time I learned about this, many years ago, textures were basically bitmap files.
- tenebrisalietum 4y agoTextures still are, but I think what OP was saying is they can be used for purposes other than painting the sides of polygons. Shaders are basically programs that run massively parallel per pixel to be rendered if I understand right.
- gcr 4y agoThis is how linden labs used to represent user-created models in Second Life! you could just upload a .jpeg of your model geometry. Not sure if that happened in the vertex shader - probably not - but a similar idea
- grishka 4y agoA jpeg? Of geometry? Compression artifacts must look funny in the rendered result. I want to see it.
- sdwr 4y agoWhats your game?
- pixelesque 4y agoYou can use various forms of projection mapping, i.e. triplanar projection or surface gradient projection... That way you only need point positions in the mesh, and no UV or normals. However, I think (at least in games: in VFX we go the other way and have many many "primvars" as vertex/point data) most real-time setups for hero objects end up having points and UVs, and then normals are normally done as a texture.