Maniphest T93086

Dot Product seems to be transformed to non-linear for some reason
Closed, Archived

Assigned To
None
Authored By
Gabriel (CuriousHobbyist)
Nov 15 2021, 3:40 AM
Tags
  • BF Blender
Subscribers
G. Solis (liquidificador)
Gabriel (CuriousHobbyist)
Hans Goudey (HooglyBoogly)
Philipp Oeser (lichtwerk)
Pratik Borhade (PratikPB2123)

Description

Operating system: Windows 10 Home
Graphics card: Intel Iris XE

Broken: 3.0 b
Worked: N/A

So I am trying to calculate texture coordinates that go around a sphere on the X axis and up the sphere on the Y. Don't get me wrong, I know that you can already set Image Texture nodes to sphere coords. But what I am trying to do is to use a spherical cage to catch caustics from an object, bake to a texture, and project them back from that object, so to do that I would need to calculate those sphere coordinates from the offset between where the incoming ray was from and the position of the object. But you can't just put that into an image texture node and have textures bake from those coordinates, and you have to use Generated output of a tex coord node for the sphere setting to work.

The problem is that I'm trying to use a Vector Math node set to dot product, and I'm getting this stretching on part of the textures. It's almost like it's not linear angle. And I don't know what goofy math I would need to bring these values back to what they should be. I've tried Power, Square Root, Inverse Square, Sine of the value * (pi / 4), everything under the sun. Is this just how dot product is supposed to function?

Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).

Event Timeline

Gabriel (CuriousHobbyist) created this task.Nov 15 2021, 3:40 AM
Pratik Borhade (PratikPB2123) added a subscriber: Pratik Borhade (PratikPB2123).Nov 15 2021, 7:56 AM
Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Needs Information from User.Nov 15 2021, 11:20 AM
Philipp Oeser (lichtwerk) added a subscriber: Philipp Oeser (lichtwerk).

Hi and thx for the report!

To speed this up, could you provide the example .blend file?

G. Solis (liquidificador) added a subscriber: G. Solis (liquidificador).Nov 15 2021, 6:36 PM

It's not a bug, your math is slightly off. That's not the appropriate place to discuss this, however; start a thread somewhere else and we can talk about it.

Gabriel (CuriousHobbyist) added a comment.Nov 15 2021, 8:01 PM
In T93086#1253909, @G. Solis (liquidificador) wrote:

It's not a bug, your math is slightly off. That's not the appropriate place to discuss this, however; start a thread somewhere else and we can talk about it.

Like where? And also is there any other way of getting the angle of a vector here? Because that's the only thing I'm needing for this.

G. Solis (liquidificador) added a comment.Nov 15 2021, 9:09 PM

The dot product of two unitary vectors doesn't give you the angle between them, but rather its cosine. Fixing it is not so simple as having them go through an arccosine node, but it's almost. Here's how it would look in nodes.

Next time please use the Blender StackExchange or the Blender Community for help.

Hans Goudey (HooglyBoogly) closed this task as Archived.Nov 15 2021, 9:18 PM
Hans Goudey (HooglyBoogly) added a subscriber: Hans Goudey (HooglyBoogly).

I'll close this task then, since yes, the dot product is not wrong here.