Box Mapping instances.
3645 5 1- pedro3145
- Member
- 41 posts
- Joined: Feb. 2014
- Offline
- eetu
- Member
- 606 posts
- Joined: May 2007
- Offline
- pedro3145
- Member
- 41 posts
- Joined: Feb. 2014
- Offline
eetu
Shading in Mantra happens in camera coordinates. You need to add a transform vop before the uv mapping vop to work in object coordinates.
Thanks for the quick response eetu!
I had to do a minor tweak to the scene you submitted, the texture was being projected on each instance and not as a whole, so I changed “To Space” to space:world.
Now, to fully address my problem I need to project the texture on each side of the instances (Box Mapping), right now the shader is only doing an Orthographic Projection. Any tips?
- eetu
- Member
- 606 posts
- Joined: May 2007
- Offline
If you want to have a sharp edge, check which axis is the closest to your normal, and choose between 3 mapping nodes based on that. Theer is an implementation of that inside an old ubershader [forums.odforce.net] I did, if you feel brave enough to dig in.
Incidentally I just happened to redo this in Unity. I wanted smooth transitions between the directions, so this time I did it by raising the normal vector to n'th power (n being the transition tightness), re-normalizing, and then blending between the three axis-aligned mapping results according to the vector components. (added bonus - no branches on gpu)
Incidentally I just happened to redo this in Unity. I wanted smooth transitions between the directions, so this time I did it by raising the normal vector to n'th power (n being the transition tightness), re-normalizing, and then blending between the three axis-aligned mapping results according to the vector components. (added bonus - no branches on gpu)
- pedro3145
- Member
- 41 posts
- Joined: Feb. 2014
- Offline
eetu
If you want to have a sharp edge, check which axis is the closest to your normal, and choose between 3 mapping nodes based on that.
Ok, I implemented what you said and is working fine.
Now, the last problem is that the texture is not moving with the points/instances, and this causes the uv coordinates to “shift”. like in the following pictures. How can I fix this?
Thanks in advance.
- eetu
- Member
- 606 posts
- Joined: May 2007
- Offline
-
- Quick Links