Global texture co-ordinates sometimes distorted when setting worldOrientation #48374

Closed
opened 2016-05-08 15:03:11 +02:00 by John Topple · 8 comments

System info
Windows 7
Nvidia geforce GTX 550 ti

blender version
2.77 and before

description

I don't usually use AlignAxisToVect() since it often gives buggy results if you use the Y axis, so I usually use something like the following:

lerp_speed = 0.02
target_vector = target.worldPosition.copy() - own.worldPosition.copy()

own.worldOrientation =  own.getAxisVect([0.0,1.0,0.0]).lerp(target_vector,lerp_speed).to_track_quat("Y","Z")

worldOrientation is a 3x3 matrix and .to_track_quat produces a Quaternion so maybe I shouldn't be able to do this, but it usually works fine.
However, when the camera moves in to a certain position using this method the global texture co-ordinates become distorted causing flickering or stretching. This affects normal materials, nodes materials, and dynamic shadows, basically anything which depends on global texture co-ordinates.

To avoid it I can convert the Quaternion to a 4x4 matrix and use it to set the worldTransform instead, but I'd like to know what causes the problem with setting orientation with Quaternions.

Here are two blend examples:
global_co-ordinates_problem.blend
This is the problem blend.
global_co-ordinates_safe2.blend

And here is the same one with 4x4 matix method. press play and wait until it rotates to 90 degrees. The texture will get distorted.

I don't know what causes the problem, but it might be better to disallow setting orientation by Quaternion if no one else knows the reason.

**System info** Windows 7 Nvidia geforce GTX 550 ti **blender version** 2.77 and before **description** I don't usually use AlignAxisToVect() since it often gives buggy results if you use the Y axis, so I usually use something like the following: ``` lerp_speed = 0.02 target_vector = target.worldPosition.copy() - own.worldPosition.copy() own.worldOrientation = own.getAxisVect([0.0,1.0,0.0]).lerp(target_vector,lerp_speed).to_track_quat("Y","Z") ``` worldOrientation is a 3x3 matrix and .to_track_quat produces a Quaternion so maybe I shouldn't be able to do this, but it usually works fine. However, when the camera moves in to a certain position using this method the global texture co-ordinates become distorted causing flickering or stretching. This affects normal materials, nodes materials, and dynamic shadows, basically anything which depends on global texture co-ordinates. To avoid it I can convert the Quaternion to a 4x4 matrix and use it to set the worldTransform instead, but I'd like to know what causes the problem with setting orientation with Quaternions. Here are two blend examples: [global_co-ordinates_problem.blend](https://archive.blender.org/developer/F309770/global_co-ordinates_problem.blend) This is the problem blend. [global_co-ordinates_safe2.blend](https://archive.blender.org/developer/F309771/global_co-ordinates_safe2.blend) And here is the same one with 4x4 matix method. press play and wait until it rotates to 90 degrees. The texture will get distorted. I don't know what causes the problem, but it might be better to disallow setting orientation by Quaternion if no one else knows the reason.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @Pickledtezcat

Added subscriber: @Pickledtezcat
Author

I'd like to know if anyone else can repeat the bug using the example file. I tried using a matrix transform but actually it didn't improve the situation.

Here are some videos of other times when the same bug cropped up in my games:
https://youtu.be/2d8__t0WMUg?t=34s
https://youtu.be/G4cSvF7bAaM?t=1m22s

I've never heard anyone else report this problem though. It can't be my computer though, the graphics card is good enough, and I've updated to the latest drivers...

I'd like to know if anyone else can repeat the bug using the example file. I tried using a matrix transform but actually it didn't improve the situation. Here are some videos of other times when the same bug cropped up in my games: https://youtu.be/2d8__t0WMUg?t=34s https://youtu.be/G4cSvF7bAaM?t=1m22s I've never heard anyone else report this problem though. It can't be my computer though, the graphics card is good enough, and I've updated to the latest drivers...
Author

I confirmed this on a computer at work rocking a crappy Intel graphics card. It's not related to drivers or graphics cards.

My guess is that it's something to do with the camera transform matrix during rendering...

I confirmed this on a computer at work rocking a crappy Intel graphics card. It's not related to drivers or graphics cards. My guess is that it's something to do with the camera transform matrix during rendering...

Added subscriber: @Sergey

Added subscriber: @Sergey
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Aaron Carlisle self-assigned this 2019-06-29 02:19:18 +02:00
Member

This task is being closed because the BGE has been removed in Blender 2.8.

This task is being closed because the BGE has been removed in Blender 2.8.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#48374
No description provided.