Differences in OpenGL support on Linux vs. OS X?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Differences in OpenGL support on Linux vs. OS X?

Phil B

I'm having some problems with code that was previously working that I've narrowed down to what I believe is a difference in platform behavior and could use some help.  The issue is that when I draw single frames in OpenGL, things work as expected on both platforms.  However, when I try to do some simple animation via Morphic stepping, it works as expected on the Mac (i.e. smooth animation at a decent framerate) but on Linux there seems to be an issue where the frame gets drawn by OpenGL then immediately drawn over with the background color so it's essentially doubling the redraw rate and looking terrible to boot.  I'm assuming (possibly incorrectly) that this is purely a VM/plugin issue as I'm using the same image file on both platforms.

The VM I'm running is from http://www.mirandabanda.org/files/Cog/VM/VM.r2550/  (i.e. the Mac and Linux versions)

Any ideas?

Thanks,
Phil

Reply | Threaded
Open this post in threaded view
|

Re: Differences in OpenGL support on Linux vs. OS X?

Bert Freudenberg

On 06.06.2012, at 18:15, "Phil (list)" <[hidden email]> wrote:

>
> I'm having some problems with code that was previously working that I've narrowed down to what I believe is a difference in platform behavior and could use some help.  The issue is that when I draw single frames in OpenGL, things work as expected on both platforms.  However, when I try to do some simple animation via Morphic stepping, it works as expected on the Mac (i.e. smooth animation at a decent framerate) but on Linux there seems to be an issue where the frame gets drawn by OpenGL then immediately drawn over with the background color so it's essentially doubling the redraw rate and looking terrible to boot.  I'm assuming (possibly incorrectly) that this is purely a VM/plugin issue as I'm using the same image file on both platforms.
>
> The VM I'm running is from http://www.mirandabanda.org/files/Cog/VM/VM.r2550/  (i.e. the Mac and Linux versions)
>
> Any ideas?
>
> Thanks,
> Phil

I seem to recall that indeed regular drawing in Linux could be seen "over" the OpenGL view.

The simplest fix would be to Not Do That ;) That is, do not do any drawing besides OpenGL - which you don't want to do in any case because of performance reasons.

- Bert -
Reply | Threaded
Open this post in threaded view
|

Re: Differences in OpenGL support on Linux vs. OS X?

Phil B

Bert,

On Jun 6, 2012, at 4:35 PM, Bert Freudenberg wrote:

>
> I seem to recall that indeed regular drawing in Linux could be seen "over" the OpenGL view.
>
> The simplest fix would be to Not Do That ;) That is, do not do any drawing besides OpenGL - which you don't want to do in any case because of performance reasons.
>
> - Bert -

As a result of following your suggestion, I have a little more detail/clarity re: what's going on.  What I thought was the background being drawn over the OpenGL view was in fact the background showing through the OpenGL view as it is mostly transparent most of the time and appears that the full OpenGL frame is not being displayed... though it does appear to have rendered in OpenGL properly based on what I can see.  I've uploaded a minimal example image that can demonstrate the issue when running on Linux yet works perfectly on OS X if you or anyone else would have a minute to look at it: https://docs.google.com/open?id=0B7kzoa_8KiEDcGFWYUcwclgybTQ (under <5 meg, publicly available)

Thanks,
Phil
Reply | Threaded
Open this post in threaded view
|

Re: Differences in OpenGL support on Linux vs. OS X?

Bert Freudenberg

On 07.06.2012, at 03:29, Phil (list) wrote:

> Bert,
>
> On Jun 6, 2012, at 4:35 PM, Bert Freudenberg wrote:
>
>>
>> I seem to recall that indeed regular drawing in Linux could be seen "over" the OpenGL view.
>>
>> The simplest fix would be to Not Do That ;) That is, do not do any drawing besides OpenGL - which you don't want to do in any case because of performance reasons.
>>
>> - Bert -
>
> As a result of following your suggestion, I have a little more detail/clarity re: what's going on.  What I thought was the background being drawn over the OpenGL view was in fact the background showing through the OpenGL view as it is mostly transparent most of the time and appears that the full OpenGL frame is not being displayed... though it does appear to have rendered in OpenGL properly based on what I can see.  I've uploaded a minimal example image that can demonstrate the issue when running on Linux yet works perfectly on OS X if you or anyone else would have a minute to look at it: https://docs.google.com/open?id=0B7kzoa_8KiEDcGFWYUcwclgybTQ (under <5 meg, publicly available)
>
> Thanks,
> Phil


This is probably unrelated, but you are apparently not using the latest OpenGL package, and you messed it up severely. Why is it using "B3DAcceleratorPlugin" instead of "libGL"?! I had to revert openGLLibraryName to make it work at all.

I do see the overdraw you mention. But if you drag your morph out of the way, you will see the triangle getting rendered by OpenGL just fine. Learn about Morphic drawing to prevent the Morph's background getting drawn again in each frame. Also learn about extraRegions to prevent anything getting drawn where your OpenGL window is. Also, enable higherPerformance and set your Morph's stepTime to 0 to see it spinning at full rate. You may want to copy FrameRateMorph over from Squeak since Cuis apparently dropped that.

Since none of this really belongs on vm-dev, please continue on Squeak's beginners list. Reply-To set accordingly.

- Bert -

Reply | Threaded
Open this post in threaded view
|

Re: Differences in OpenGL support on Linux vs. OS X?

Bert Freudenberg

On 07.06.2012, at 12:25, Bert Freudenberg wrote:

> Since none of this really belongs on vm-dev, please continue on Squeak's beginners list. Reply-To set accordingly.


How about we disable reply-to munging for vm-dev? This came out not as expected.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: Differences in OpenGL support on Linux vs. OS X?

David T. Lewis
 
On Thu, Jun 07, 2012 at 12:28:52PM +0200, Bert Freudenberg wrote:

>
> On 07.06.2012, at 12:25, Bert Freudenberg wrote:
>
> > Since none of this really belongs on vm-dev, please continue on Squeak's beginners list. Reply-To set accordingly.
>
>
> How about we disable reply-to munging for vm-dev? This came out not as expected.
>
> - Bert -
>

The vm-dev list is currently set for reply to "This list", an you are suggesting
that reply to should be "Sender", which according to the mailman help screen is
"strongly recommended".

I am not an expert on this - does anyone object to this change? I'll update it
later today if no objections.

Dave
 
Reply | Threaded
Open this post in threaded view
|

Re: Differences in OpenGL support on Linux vs. OS X?

Phil B
In reply to this post by Bert Freudenberg

Bert,

On Jun 7, 2012, at 6:25 AM, Bert Freudenberg wrote:

>
> This is probably unrelated, but you are apparently not using the latest OpenGL package, and you messed it up severely. Why is it using "B3DAcceleratorPlugin" instead of "libGL"?! I had to revert openGLLibraryName to make it work at all.
>

The short answer is that my work with OpenGL predated a lot of the discussion/documentation that's now available for Squeak and involved a lot of trial and error, so yes I'm considerably out of date and probably doing some screwy/wrong things and plan to correct that.

I *think* you identified my issue re: B3DAcceleratorPlugin.  When I initially tried to get the code running on Linux I was getting module not found errors and so I incorrectly did a search and replace to replace the module names (and accidentally went a little beyond that) which resulted in the appearance of OpenGL working on Ubuntu 12.04... and it sort of works (i.e. it's drawing but very poorly via B3D and I think I was/am getting confused re: internal vs. external plugins and how B3D fit into the mix with OpenGL.  I vaguely recall going down this path several years ago when I was attempting to initially get it running on OS X.)

Based on some further research on squeak-dev, the real issue appears to be my machines configuration (libGL isn't where the VM expects it)... and you're right, that's not a vm-dev issue but I do thank you for helping to point me in what appears to be the right direction to resolve this.

Now if none of what I've said makes sense, then I'm still lost but I'll take further discussion off of vm-dev.

Thanks,
Phil
Reply | Threaded
Open this post in threaded view
|

Re: Differences in OpenGL support on Linux vs. OS X?

Hans-Martin Mosner
In reply to this post by Phil B
 
Am 06.06.2012 18:15, schrieb Phil (list):

>  
> I'm having some problems with code that was previously working that I've narrowed down to what I believe is a difference in platform behavior and could use some help.  The issue is that when I draw single frames in OpenGL, things work as expected on both platforms.  However, when I try to do some simple animation via Morphic stepping, it works as expected on the Mac (i.e. smooth animation at a decent framerate) but on Linux there seems to be an issue where the frame gets drawn by OpenGL then immediately drawn over with the background color so it's essentially doubling the redraw rate and looking terrible to boot.  I'm assuming (possibly incorrectly) that this is purely a VM/plugin issue as I'm using the same image file on both platforms.
>
> The VM I'm running is from http://www.mirandabanda.org/files/Cog/VM/VM.r2550/  (i.e. the Mac and Linux versions)
>
> Any ideas?
>
> Thanks,
> Phil
>
>
This is caused by an (IMO incorrect) setting in the code that creates the X drawing context in sqUnixX11.c:
gcValues.subwindow_mode= IncludeInferiors;
This allows X to draw over subwindows of the main window, which is generally a bad idea.
I have changed that to ClipChildren with the desired effect.
I also notified Ian Piumarta of this, but as of now there has not been an official change to this file.
On my system, I currently do not have a working VMMaker setup, so I just binary patched the vm-display-X11 plugin and
have 3D as it is meant to be :-)

Cheers,
Hans-Martin


Reply | Threaded
Open this post in threaded view
|

Re: Differences in OpenGL support on Linux vs. OS X?

Bert Freudenberg


On 2012-06-09, at 16:59, Hans-Martin Mosner wrote:

>
> Am 06.06.2012 18:15, schrieb Phil (list):
>>
>> I'm having some problems with code that was previously working that I've narrowed down to what I believe is a difference in platform behavior and could use some help.  The issue is that when I draw single frames in OpenGL, things work as expected on both platforms.  However, when I try to do some simple animation via Morphic stepping, it works as expected on the Mac (i.e. smooth animation at a decent framerate) but on Linux there seems to be an issue where the frame gets drawn by OpenGL then immediately drawn over with the background color so it's essentially doubling the redraw rate and looking terrible to boot.  I'm assuming (possibly incorrectly) that this is purely a VM/plugin issue as I'm using the same image file on both platforms.
>>
>> The VM I'm running is from http://www.mirandabanda.org/files/Cog/VM/VM.r2550/  (i.e. the Mac and Linux versions)
>>
>> Any ideas?
>>
>> Thanks,
>> Phil
>>
>>
> This is caused by an (IMO incorrect) setting in the code that creates the X drawing context in sqUnixX11.c:
> gcValues.subwindow_mode= IncludeInferiors;
> This allows X to draw over subwindows of the main window, which is generally a bad idea.
> I have changed that to ClipChildren with the desired effect.
> I also notified Ian Piumarta of this, but as of now there has not been an official change to this file.
> On my system, I currently do not have a working VMMaker setup, so I just binary patched the vm-display-X11 plugin and
> have 3D as it is meant to be :-)


Ah. Sounds like a good idea to remind him :)

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: Differences in OpenGL support on Linux vs. OS X?

Igor Stasenko
In reply to this post by Hans-Martin Mosner

added
http://code.google.com/p/cog/issues/detail?id=84

On 9 June 2012 16:59, Hans-Martin Mosner <[hidden email]> wrote:

>
> Am 06.06.2012 18:15, schrieb Phil (list):
>>
>> I'm having some problems with code that was previously working that I've narrowed down to what I believe is a difference in platform behavior and could use some help.  The issue is that when I draw single frames in OpenGL, things work as expected on both platforms.  However, when I try to do some simple animation via Morphic stepping, it works as expected on the Mac (i.e. smooth animation at a decent framerate) but on Linux there seems to be an issue where the frame gets drawn by OpenGL then immediately drawn over with the background color so it's essentially doubling the redraw rate and looking terrible to boot.  I'm assuming (possibly incorrectly) that this is purely a VM/plugin issue as I'm using the same image file on both platforms.
>>
>> The VM I'm running is from http://www.mirandabanda.org/files/Cog/VM/VM.r2550/  (i.e. the Mac and Linux versions)
>>
>> Any ideas?
>>
>> Thanks,
>> Phil
>>
>>
> This is caused by an (IMO incorrect) setting in the code that creates the X drawing context in sqUnixX11.c:
> gcValues.subwindow_mode= IncludeInferiors;
> This allows X to draw over subwindows of the main window, which is generally a bad idea.
> I have changed that to ClipChildren with the desired effect.
> I also notified Ian Piumarta of this, but as of now there has not been an official change to this file.
> On my system, I currently do not have a working VMMaker setup, so I just binary patched the vm-display-X11 plugin and
> have 3D as it is meant to be :-)
>
> Cheers,
> Hans-Martin
>
>



--
Best regards,
Igor Stasenko.