Closed GoogleCodeExporter closed 9 years ago
I explored another workaround listed here.
http://www.opengl.org/discussion_boards/showthread.php/164372-Remote-Desktop
"You can do that with Mesa3D : current version is 7.2, and support OpenGL 2.1
in a complete software implementation.
Compile or find a windows mesa .dll, and put it as opengl32.dll on your exe
folder."
I got the mesa opengl32.dll (18MB...) and installed it into the folder that
contains the java.exe. Then it displayed fine when started from a remote
desktop session.
But copying things to the JDK/JRE folder isn't great. I was hoping MSFT would
search for the current dir or entries in %PATH% before reaching to the
system32, but that didn't work in my test. The only way it would use it would
be after I remove MSFT's opengl32.dll from system32/.
Tips welcome, I'm interested in a friendly workaround - either by avoiding the
calls not supported by MSFT opengl32.dll or by finding a way to tell jogl to
use an alternative opengl32.dll in the current dir...
Original comment by christop...@gmail.com
on 24 Jan 2014 at 6:24
In case anyone wants to test comment 1 above, here's a link to a binary of mesa
opengl32.dll :
http://hivelocity.dl.sourceforge.net/project/msys2/REPOS/MINGW/x86_64/mingw-w64-
x86_64-mesa-10.0.1-2-any.pkg.tar.xz
Original comment by christop...@gmail.com
on 24 Jan 2014 at 6:46
The following code renders the whole buffer with glDrawPixels when we detect
hardware rendering isn't available. This works over MSFT Remote Desktop. What
do you think? I suspect a CEF or OpenGL expert would have better alternatives
to suggest?
CefRenderer.java
//Workaround for Windows Remote Desktop unable to deal with npot textures
private boolean useDrawPixels = false;
protected void initialize(GL2 gl2) {
if (initialized_)
return;
if (!gl2.getContext().isHardwareRasterizer()) {
useDrawPixels = true;
System.out.println("opengl rendering may be slow as hardware rendering isn't available");
initialized_ = true;
return;
}
...
protected void render(GL2 gl2) {
if (useDrawPixels) {
return;
}
...
protected void onPaint(GL2 gl2,
boolean popup,
Rectangle[] dirtyRects,
ByteBuffer buffer,
int width,
int height) {
if (!initialized_)
initialize(gl2);
if (useDrawPixels) {
gl2.glRasterPos2f(-1,1);
gl2.glPixelZoom( 1, -1 );
gl2.glDrawPixels(width, height, GL2.GL_BGRA, GL2.GL_UNSIGNED_BYTE, buffer);
return;
}
...
Original comment by christop...@gmail.com
on 27 Jan 2014 at 4:31
How does the glDrawPixels approach behave from a performance standpoint
(framerate, CPU/GPU usage) compared to the texture approach?
Other approaches include creating the view from a grid of tiled power-of-2
textures, or creating a single power-of-2 texture that is larger than the
window size and only rendering to a portion of it.
To support the maximal number of devices it might be worthwhile to use only
GLES2 interfaces (issue #19).
Original comment by magreenb...@gmail.com
on 27 Jan 2014 at 11:05
> How does the glDrawPixels approach behave from a performance standpoint
(framerate, CPU/GPU usage) compared to the texture approach?
I pointed MainFrame.java to this site http://www.smashcat.org/av/canvas_test/ .
If you have a preferred graphics benchmark, let me know and I'll re-run the
tests.
To my surprise, there wasn't much difference between the 2 approaches in this
particular case. The FPS wasn't affected and the GPU/CPU load didn't really
differ.
1) Original (textures)
FPS: ~ 160
GPU load: ~ 17%
CPU load: ~ 5%
2) glDrawPixels
FPS: ~ 160
GPU load: ~ 21%
CPU load: ~ 6%
3) glDrawPixels over Remote Desktop (over a fast LAN)
FPS: ~ 174 (not sure this is the effective RDP rate but it felt smooth anyway)
Original comment by christop...@gmail.com
on 28 Jan 2014 at 2:18
Original comment by magreenb...@gmail.com
on 17 Jun 2014 at 6:34
Thanks, added in revision 86. There's probably a better way to test if non-pot
textures are supported (there might be some hardware that doesn't support it
too), but I'm not sure what it is.
Original comment by magreenb...@gmail.com
on 17 Jun 2014 at 6:50
Original issue reported on code.google.com by
christop...@gmail.com
on 24 Jan 2014 at 2:25