TextureTransform like Homography

Hi guys!
It is possible to transform a texture, in order to fit a deformed mesh?
Have a look:

Let’s say that the right quad, deformed with the Homography node, is the look I wanna achieve. Can I apply some kind of Transformation on the Texture Transform in the Constant (EX9.effect) ??
or perhaps I can transform in some way the Texture Coordinates in the VertexBuffer (EX9.Geometry Join) ??

Any idea? Help me please!

I forgot to attach the file! :P sorry

Texture.v4p (13.8 kB)

tex coords just get interpolated between vertices, you can’t apply perspective transformations on them. one way would be to have a very dens grid, that you dont see the interpolation. or you can render a geometry transformed by homography with DX9Texture…

tex coords just get interpolated between vertices, you can’t apply perspective transformations on them. one way would be to have a very dense grid, that you don’t see the interpolation. or you just render a geometry transformed by homography with DX9Texture…

I see! The problem is, I did’t know the amount of mesh before! And Render (Render->DX9Texture) is not spreadable, I think… :(

What about transform the Texture? If I can obtain the transformation coordinates from the homography, then I can have a spread of inverse transformation (and apply them on Texture Transform in the Constant (EX9.effect) ) perhaps. I’ll give a try

also texture transform has the same limitations… but you could apply the homography transformation in the shader to a 4D texture coordinate with (x, y, 0, 1) and then divide the x and y by the w component after. but i still believe that you need a quite dense grid… or try to do the transformation as described in the pixel shader. because there you have a coordinate for each pixel and not per vertex.

I usually use a 20 by 20 grid into a constant shader, that works very in the cases I have used it

I partially solved by

  1. creating a spread of HomoGraphy and apply it to a Grid (EX9.Geometry) (Why the spread of homography transformation doesn’t work with Quad???)
  2. Render->DX9Texture
  3. giving each mesh the Texture Coordinates of the correspondent grid

BTW I’d like to try your suggestion, but I’m not following you on “shader to a 4D texture coordinate with (x, y, 0, 1)”, sorry :(