BMText fails to render after r1838
7 posts
• Page 1 of 1
BMText fails to render after r1838
Hi!
I have a scene with box like objects with labels on them. The boxes are loaded as Collada models and the labels are BMText objects. After revision 1838 in the Ardor3D trunk the labels disappear. I have found that one line in AbstractRenderBucket makes the difference. The code with the included diff works:
As far as I can tell the BMText objects don't use a bounding volume so the else block is run for the BMText objects and the if for the box objects. If anyone can point me in the right direction I will be thankful! I have looked at this some hours now and can't seem to figure out what goes wrong...
Martin
I have a scene with box like objects with labels on them. The boxes are loaded as Collada models and the labels are BMText objects. After revision 1838 in the Ardor3D trunk the labels disappear. I have found that one line in AbstractRenderBucket makes the difference. The code with the included diff works:
- Code: Select all
@@ -135,7 +135,8 @@
final Camera cam = Camera.getCurrentCamera();
if (spat.getWorldBound() != null && Vector3.isValid(spat.getWorldBound().getCenter())) {
- spat._queueDistance = spat.getWorldBound().distanceToEdge(cam.getLocation());
+// spat._queueDistance = spat.getWorldBound().distanceToEdge(cam.getLocation());
+ spat._queueDistance = cam.getLocation().distance(spat.getWorldBound().getCenter());
} else {
final ReadOnlyVector3 spatPosition = spat.getWorldTranslation();
if (!Vector3.isValid(spatPosition)) {
- Code: Select all
getWorldBound().distanceToEdge
As far as I can tell the BMText objects don't use a bounding volume so the else block is run for the BMText objects and the if for the box objects. If anyone can point me in the right direction I will be thankful! I have looked at this some hours now and can't seem to figure out what goes wrong...
Martin
- martifa
- regular
- Posts: 67
- Joined: Thu Sep 15, 2011 5:16 am
Re: BMText fails to render after r1838
I don't reproduce your problem, I use a BMText very early in the introduction scene of TUER. I don't understand why the current code queues the distance between the spatial and the nearest edge.
- gouessej
- regular
- Posts: 1206
- Joined: Fri May 01, 2009 3:26 am
- Location: France
Re: BMText fails to render after r1838
OK, thanks for trying!
I use a BasicText object to display the FPS on screen. That one is rendered in ortho mode and works well, but I have not tried replacing it for a BMText object. I should probably add that I use a texture renderer to render the scene with the disappearing labels, but I don't see why that should change things.
The code does not compute the distance between the spatial and the nearest edge but between the nearest edge of the bounding volume of the spatial and the location of the current camera, as opposed to the distance between the camera and the center of the bounding volume. I guess it is more precise. My BMText objects have blending enabled so they should be on the TransparentRenderBucket queue, while the boxes are on the Opaque queue. I don't understand what is going on...
Martin
I use a BasicText object to display the FPS on screen. That one is rendered in ortho mode and works well, but I have not tried replacing it for a BMText object. I should probably add that I use a texture renderer to render the scene with the disappearing labels, but I don't see why that should change things.
gouessej wrote:I don't understand why the current code queues the distance between the spatial and the nearest edge.
The code does not compute the distance between the spatial and the nearest edge but between the nearest edge of the bounding volume of the spatial and the location of the current camera, as opposed to the distance between the camera and the center of the bounding volume. I guess it is more precise. My BMText objects have blending enabled so they should be on the TransparentRenderBucket queue, while the boxes are on the Opaque queue. I don't understand what is going on...
Martin
- martifa
- regular
- Posts: 67
- Joined: Thu Sep 15, 2011 5:16 am
Re: BMText fails to render after r1838
Is it possible you are running a visitor on your scene that sets the modelBound?
Gratitude is a mark of a noble soul and a refined character.
-

renanse - Site Admin
- Posts: 2958
- Joined: Tue Oct 28, 2008 6:49 pm
- Location: Austin, TX
Re: BMText fails to render after r1838
If I would have to manually add a visitor the answer is no. If I've understood things correctly, the distance computed here is used to sort the render queues, right? And nothing should be culled based on these distances?
- martifa
- regular
- Posts: 67
- Joined: Thu Sep 15, 2011 5:16 am
Re: BMText fails to render after r1838
Right, but for that line to affect things, either you somehow have a bounding volume on your bmtext, or your scene sorting has changed and something else is drawing in such a way as to cover up your text (perhaps depth test related.)
Gratitude is a mark of a noble soul and a refined character.
-

renanse - Site Admin
- Posts: 2958
- Joined: Tue Oct 28, 2008 6:49 pm
- Location: Austin, TX
Re: BMText fails to render after r1838
Sounds reasonable, thanks for the input!
I still have a bit of difficulties understanding how that line could cause my stuff to fail. Say I did add a bounding volume to the text and disabled depth testing. Wouldn't then the text always show because the only object that could cover it is opaque (the box) and would be rendered before the text which has blending enabled and thus is rendered after it on the transparent render bucket queue? I agree I probably am to blame in some way, I just have a hard time understanding what could cause this...
I will look into it and let you know what I find!
Martin
I still have a bit of difficulties understanding how that line could cause my stuff to fail. Say I did add a bounding volume to the text and disabled depth testing. Wouldn't then the text always show because the only object that could cover it is opaque (the box) and would be rendered before the text which has blending enabled and thus is rendered after it on the transparent render bucket queue? I agree I probably am to blame in some way, I just have a hard time understanding what could cause this...
I will look into it and let you know what I find!
Martin
- martifa
- regular
- Posts: 67
- Joined: Thu Sep 15, 2011 5:16 am
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest