Text Font Bug #33163

Closed
opened 2012-11-13 19:45:42 +01:00 by Thomas Szepe · 12 comments
Member

Category: Rendering

%%%If you enable wire shading on a material and you run the file with the BlenderPlayer the font text don't will be displayed correctly.
The embedded player working correct.

Tested on Windows XP 32 Bit with
Blender 2.59 not working
Blender 2.62 not working
Blender 2.63a not working
Blender 2.64a not working
Blender 2.64.9 r52065 not working%%%

**Category**: Rendering %%%If you enable wire shading on a material and you run the file with the BlenderPlayer the font text don't will be displayed correctly. The embedded player working correct. Tested on Windows XP 32 Bit with Blender 2.59 not working Blender 2.62 not working Blender 2.63a not working Blender 2.64a not working Blender 2.64.9 r52065 not working%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

%%%I fond out why this happens. in the GPC_RenderTools.cpp there is glPolygonMode(GL_FRONT_AND_BACK, GL_FILL) in RenderText3D.

I have attached a patch.%%%

%%%I fond out why this happens. in the GPC_RenderTools.cpp there is glPolygonMode(GL_FRONT_AND_BACK, GL_FILL) in RenderText3D. I have attached a patch.%%%

%%%The patch seems ok, but what effect do you expect when using wireframe in a text object?%%%

%%%The patch seems ok, but what effect do you expect when using wireframe in a text object?%%%
Author
Member

%%%A user from the Blendpolis forum uses a box in wireframe mode to get a outline around the selected menu text.
I attached a new file where you can see the effect in the blenderplayer if you move the mouse over the text.

A other uses the wireframe mode for displaying the weapons as wireframe in the weapon select menu.
But without the fix the text also render in wireframe in the blenderplayer.
%%%

%%%A user from the Blendpolis forum uses a box in wireframe mode to get a outline around the selected menu text. I attached a new file where you can see the effect in the blenderplayer if you move the mouse over the text. A other uses the wireframe mode for displaying the weapons as wireframe in the weapon select menu. But without the fix the text also render in wireframe in the blenderplayer. %%%
Author
Member

%%%I don't want to render the text in wireframe. I want to render it filled like in the embedded player.

Sorry if I confused you with my second post. What I want to write was.
In the GPC_RenderTools.cpp there is glPolygonMode(GL_FRONT_AND_BACK, GL_FILL) in RenderText3D missing.
%%%

%%%I don't want to render the text in wireframe. I want to render it filled like in the embedded player. Sorry if I confused you with my second post. What I want to write was. In the GPC_RenderTools.cpp there is glPolygonMode(GL_FRONT_AND_BACK, GL_FILL) in RenderText3D missing. %%%

%%%I talked with Diego Borghetti (blf mantainer) and he said the patch is ok, but it should add a glGet before changing it to restore the polygon mode state after the text is drawn.
At first I thought he may wanted to handle this inside BLF, thus the delay in the review.

Can you do the above changes? Thanks%%%

%%%I talked with Diego Borghetti (blf mantainer) and he said the patch is ok, but it should add a glGet before changing it to restore the polygon mode state after the text is drawn. At first I thought he may wanted to handle this inside BLF, thus the delay in the review. Can you do the above changes? Thanks%%%

%%%I'd try to avoid glGet if possible. It slows things down and I've been trying to remove all uses of it in the BGE. Maybe use glPushAttrib instead? However, that might be deprecated.%%%

%%%I'd try to avoid glGet if possible. It slows things down and I've been trying to remove all uses of it in the BGE. Maybe use glPushAttrib instead? However, that might be deprecated.%%%
Author
Member

%%%I have now written two new patches one with glGet and one with glPushAttrib. So you can choose the patch you like.
I've been looking into the source code and found both commands.
The command glPushAttrib works up to OpenGL 2.1 and does no longer exists in OpenGL 3.0.

But I think that it is unnecessary to store and restore the value, because the font object is at the end of the render loop in front PostRenderScene call.%%%

%%%I have now written two new patches one with glGet and one with glPushAttrib. So you can choose the patch you like. I've been looking into the source code and found both commands. The command glPushAttrib works up to OpenGL 2.1 and does no longer exists in OpenGL 3.0. But I think that it is unnecessary to store and restore the value, because the font object is at the end of the render loop in front PostRenderScene call.%%%

%%%The embedded player doesn't bother with attempting to restore the previous state, so the Blenderplayer shouldn't either. Although, looking at KX_BlenderGL::DisableForText(), it looks like the Blenderplayer is also not disabling the following: alpha blending, alpha testing, lighting , and color materials. I'm thinking the solution should be to copy the code from DisableForText() and put it into GPC_RenderTools::RenderText3D, so the two RenderTools are identical in this aspect again. Fairly soon I plan to get both players onto a single RenderTools (or drop RenderTools and merge it completely into the rasterizer), but until then, we might as well get this bug fixed.%%%

%%%The embedded player doesn't bother with attempting to restore the previous state, so the Blenderplayer shouldn't either. Although, looking at KX_BlenderGL::DisableForText(), it looks like the Blenderplayer is also not disabling the following: alpha blending, alpha testing, lighting , and color materials. I'm thinking the solution should be to copy the code from DisableForText() and put it into GPC_RenderTools::RenderText3D, so the two RenderTools are identical in this aspect again. Fairly soon I plan to get both players onto a single RenderTools (or drop RenderTools and merge it completely into the rasterizer), but until then, we might as well get this bug fixed.%%%
Author
Member

%%%I don't added KX_BlenderGL::DisableForText() the other disable for alpha blending, alpha testing, lighting and color materials, because so the user can decide if he want to
render the Text shadeless or not.

My suggestion is to remove the disable calls from the KX_BlenderGL::DisableForText() to, if it doesn't makes any other problems.

%%%

%%%I don't added KX_BlenderGL::DisableForText() the other disable for alpha blending, alpha testing, lighting and color materials, because so the user can decide if he want to render the Text shadeless or not. My suggestion is to remove the disable calls from the KX_BlenderGL::DisableForText() to, if it doesn't makes any other problems. %%%

%%%I've committed your fix of adding glPolygonMode(GL_FRONT_AND_BACK, GL_FILL) to GPC_RenderTools::RenderText3D as r57623. I did not commit any of the glGet/glPushAttrib code as I think this is unnecessary and just slows things down. As for copying more of the disables or removing them from DisableForText(), I think that is better left for after the next release (we're supposed to only be doing bug fixes right now).

Thanks for the fix!%%%

%%%I've committed your fix of adding glPolygonMode(GL_FRONT_AND_BACK, GL_FILL) to GPC_RenderTools::RenderText3D as r57623. I did not commit any of the glGet/glPushAttrib code as I think this is unnecessary and just slows things down. As for copying more of the disables or removing them from DisableForText(), I think that is better left for after the next release (we're supposed to only be doing bug fixes right now). Thanks for the fix!%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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#33163
No description provided.