Jump to content

Distorting textured objects - ideas required


waechtertroll
 Share

Recommended Posts

Hello,

although I don't have enough spare time to create games at the moment, I'm playing a bit around with code to understand game mechanics. At the moment I'm teaching myself soft body dynamics.

I can create an entity consisting just of cordinates (say a sphere) and play around with their shape, wobbling, squishing etc. But I'm at a loss at how to bind a texture to them that actually distorts according to the coord changes; preferrably in a way performant enough to use it in a game, and most preferrably done in Pixijs.

Maybe I'll have to cut the texture into a mesh, bind UV coordinates to them and then use something like three.js to render it?

I see that e.g. Dragonbone has some way to add meshes to characters - plus it can be used from pixi. Will it distort textures properly when I modify mesh coordinates, or is this information only used when exporting animations?

What other approaches can you think of?

Link to comment
Share on other sites

If your sphere consists of some kind of geometry with uv mapped textures, distorting the geometry should as well distort the displayed texture.

According to the API of PIXI http://pixijs.download/release/docs/PIXI.mesh.Mesh.html: You should (for example) specify both vertices and their UV coordinates, if you want to have this performant you need to distort the verticies in your vertex shader as well: http://pixijs.download/release/docs/PIXI.Shader.html

Please note that I have not tried this.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...