Video Texture (bge.texture) ImageRender / ImageMirror broken #30173

Closed
opened 2012-02-13 22:41:16 +01:00 by Thomas Szepe · 24 comments
Member

%%%On all Blender versions (I think) higher than 2.61.4 r43747, the ImageRender and ImageMirror from the video texture module did not work any more.

Last test on Blender 2.61.4 r44098, ImageRender and ImageMirror still not working.

Windows XP 32 Bit.
%%%

%%%On all Blender versions (I think) higher than 2.61.4 r43747, the ImageRender and ImageMirror from the video texture module did not work any more. Last test on Blender 2.61.4 r44098, ImageRender and ImageMirror still not working. Windows XP 32 Bit. %%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

%%%strange, I recall Benoit fixing ImageRender.
ImageMirror I'm using in a project and seems to be working fine.

confirmed that this file render black - OSX svn > 2.62rc%%%

%%%strange, I recall Benoit fixing ImageRender. ImageMirror I'm using in a project and seems to be working fine. confirmed that this file render black - OSX svn > 2.62rc%%%
Author
Member

%%%I have uploaded a the mirror example which I used for testing.%%%

%%%I have uploaded a the mirror example which I used for testing.%%%

%%%interesting, the bug is actually that video texture seems to be buggy at frame 1.
change your sensors to a delay sensor with delay one and they both work%%%

%%%interesting, the bug is actually that video texture seems to be buggy at frame 1. change your sensors to a delay sensor with delay one and they both work%%%
Author
Member

%%%Confirmed .
With the delay sensor it is working.%%%

%%%Confirmed . With the delay sensor it is working.%%%
Member

%%%This bug is caused by the canvas display area being initialized on render frame 1, which happens after logic frame 1.
Fixed by initializing the area at canvas creation.

Fixed in revision 44225
%%%

%%%This bug is caused by the canvas display area being initialized on render frame 1, which happens after logic frame 1. Fixed by initializing the area at canvas creation. Fixed in revision 44225 %%%
Author
Member

%%%Thank you for fixing this bug.
But I think you have forgotten to fix the blenderplayer.%%%

%%%Thank you for fixing this bug. But I think you have forgotten to fix the blenderplayer.%%%
Member

%%%In fact I fixed the blenderplayer, but as I'm testing it, I realize that the logic doesn't work at all: I seems that the logic bricks are not loaded with the file. I will check that asap%%%

%%%In fact I fixed the blenderplayer, but as I'm testing it, I realize that the logic doesn't work at all: I seems that the logic bricks are not loaded with the file. I will check that asap%%%

%%%I'm going to reopen this until the player is fixed.%%%

%%%I'm going to reopen this until the player is fixed.%%%
Member

%%%As it seems the player now works correctly: the blend file works well in the player. Can you verify that before I close the ticket?%%%

%%%As it seems the player now works correctly: the blend file works well in the player. Can you verify that before I close the ticket?%%%
Author
Member

%%%I am sorry. The both files that I uploaded before was only to show the first bug that you have fixed. With this files you can't see the Blenderplayer bug.
I uploaded a new file .

Working with Blender

Working with Blenderplayer if a always sensor has pulse mode is on.
Not working with Blenderplayer if a always sensor has pulse mode is off.
Working with Blenderplayer if a delaysensor has a delay of 1 and pulse mode is off.

Not working Blenderplayer if the player is started with the start button in the standalone player panel.
It seams to be a path problem. I made all paths relative, but If I start the player with these button the paths will change back to absolute on Blender 2.64a.
Blender 2.94.9 r52796 don't change the texture phat but in the console I get the same error.
Path cant be made relative "D:.....\Blender Files\RealtimeTextureSwitching\Happy.png"
%%%

%%%I am sorry. The both files that I uploaded before was only to show the first bug that you have fixed. With this files you can't see the Blenderplayer bug. I uploaded a new file . Working with Blender Working with Blenderplayer if a always sensor has pulse mode is on. Not working with Blenderplayer if a always sensor has pulse mode is off. Working with Blenderplayer if a delaysensor has a delay of 1 and pulse mode is off. Not working Blenderplayer if the player is started with the start button in the standalone player panel. It seams to be a path problem. I made all paths relative, but If I start the player with these button the paths will change back to absolute on Blender 2.64a. Blender 2.94.9 r52796 don't change the texture phat but in the console I get the same error. Path cant be made relative "D:\.....\Blender Files\RealtimeTextureSwitching\Happy.png" %%%
Member

%%%The problem in the player is different than the original ImageRender problem: in the player, the image textures are only initialized in the GPU on the first render frame, which happens after the first logic frame, so that the texture created by VideoTexture in the first frame are deleted and overwritten by the GPU.

To work around this problem, VideoTexture can force a GPU load before swapping the texture id. This works for simple image texture, not necessarily with more complex images (sequence, movies,..) because they can have multiple buffers and VideoTexture has no way to tell which buffer the GPU will need. I don't think this is an issue though: these complex images will in any case interfere badly with VideoTexture, they should not be used as base for swapping a new Texture.

Note that the problem does not exist when using materials (texture.materialID(obj, 'MA...')) because the game engine initializes the materials during conversion.

I did not commit the patch yet because Blender is RC phase. The patch is available here: http://www.pasteall.org/37856/diff
%%%

%%%The problem in the player is different than the original ImageRender problem: in the player, the image textures are only initialized in the GPU on the first render frame, which happens after the first logic frame, so that the texture created by VideoTexture in the first frame are deleted and overwritten by the GPU. To work around this problem, VideoTexture can force a GPU load before swapping the texture id. This works for simple image texture, not necessarily with more complex images (sequence, movies,..) because they can have multiple buffers and VideoTexture has no way to tell which buffer the GPU will need. I don't think this is an issue though: these complex images will in any case interfere badly with VideoTexture, they should not be used as base for swapping a new Texture. Note that the problem does not exist when using materials (texture.materialID(obj, 'MA...')) because the game engine initializes the materials during conversion. I did not commit the patch yet because Blender is RC phase. The patch is available here: http://www.pasteall.org/37856/diff %%%
Author
Member

%%%With your patch the player is now working with my test file.

But there are two new memory leaks now .
ImBuf_struct len: 2304 02AD3418
imb_addrectImBuf len: 16384 06810020%%%

%%%With your patch the player is now working with my test file. But there are two new memory leaks now . ImBuf_struct len: 2304 02AD3418 imb_addrectImBuf len: 16384 06810020%%%
Member

%%%The memory leak is actually not the fault of VideoTexture: if you manually close (delete) the texture before quitting the game you will see that there is no leak.

The fact is that the player does not automatically clean the logic object when leaving the game. This is a different problem that should be reported separately.%%%

%%%The memory leak is actually not the fault of VideoTexture: if you manually close (delete) the texture before quitting the game you will see that there is no leak. The fact is that the player does not automatically clean the logic object when leaving the game. This is a different problem that should be reported separately.%%%
Author
Member

%%%Yes I know, but the funny thing is that without the patch the memory will automatically cleaned.

I have made a bug report [#32708] two month ago and I think that is the same issue.%%%

%%%Yes I know, but the funny thing is that without the patch the memory will automatically cleaned. I have made a bug report [#32708] two month ago and I think that is the same issue.%%%

%%%Benoit, can your patch be committed?%%%

%%%Benoit, can your patch be committed?%%%
Member

%%%Yes the patch can be committed. It's a reasonable solution to the problem.
The memory leak should be addressed separately.%%%

%%%Yes the patch can be committed. It's a reasonable solution to the problem. The memory leak should be addressed separately.%%%
Member

%%%Has this been committed to Trunk yet?%%%

%%%Has this been committed to Trunk yet?%%%

This issue was referenced by 05db026d8ab389f434a43ec4e7c84f0c964c1c4a

This issue was referenced by 05db026d8ab389f434a43ec4e7c84f0c964c1c4a
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

Closed by commit 05db026d8a.

Closed by commit 05db026d8a.
Member

Added subscriber: @brita

Added subscriber: @brita
Member

I committed Benoit's patch, the second commit that is then removed is just the merge with my branch (I was still testing git).

I committed Benoit's patch, the second commit that is then removed is just the merge with my branch (I was still testing git).

This issue was referenced by cf4646b95f

This issue was referenced by cf4646b95f7dac74fb67300a2df43bc973e7709d
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
7 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#30173
No description provided.