Barycentric puzzle

Started by
9 comments, last by unbird 10 years, 7 months ago

Thanks unbird! One of the reasons I'm using triangle patches at the corners, is that it's the simplest way to describe the full interaction between the three neighboring hexes, and they are seamlessly tile-able as well. I originally tried to describe full hexes, and the fact that you are dealing with 6 neighbors rather than three was really complicating things at the time. Coming up with tangent frames and blend weights with that amount of interaction was a big mouthful in a shader.

Yeah, I saw that. My idea was to start with a hex made of six equilateral triangles, but then look at the triangles individually. Well, excuse if I underestimated your research effort, I was just thinking out loud providing alternatives. I'm not sure anyway if it will provide any advantage.

Anyway: The approach I demonstrated uses a pixel shader. For performance try pulling (at least) the line evaluation up the shader pipeline. It's linear, so interpolation should pose no problem. It's similar to a plane equation for e.g. custom clipping with SV_ClipDistance.

I also recommend reading more about linear algebra. E.g. what c.w.chambers showed is (apart from the rounding) more or less a shear transformation. Barycentrics, determinants, etc., yeah, all linear algebra.

This topic is closed to new replies.

Advertisement