帮助调试 Java3d 应用程序中的 GL_VERSION 错误

发布于 2024-08-12 21:07:14 字数 1243 浏览 1 评论 0原文

我正在开发一个用 java 编写的 3d 地球仪应用程序,使用 java3d 进行渲染。我有一个 Windows 安装程序,它基本上将文件从开发快照复制到程序文件目录。它从开发快照运行良好,但是在安装后运行时它会执行以下操作:

Java 3D ERROR : OpenGL 1.2 or better is required (GL_VERSION=1.1)  
javax.media.j3d.IllegalRenderingStateException: GL_VERSION  
    at javax.media.j3d.NativePipeline.createNewContext(Native Method)  
    at javax.media.j3d.NativePipeline.createNewContext(NativePipeline.java:2736)  
    at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:4895)  
    at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:2421)  
    at javax.media.j3d.Renderer.doWork(Renderer.java:895)  
    at javax.media.j3d.J3dThread.run(J3dThread.java:256)  

我比较了开发目录中的所有库和 jar,文件都完全相同并且没有丢失。这是最奇怪的事情。我已经更新了我的图形驱动程序(尽管它们显然已经足够了,因为从开发快照来看一切运行良好)。我编写了一个简单的 java3d 应用程序,它能够制作 Canvas3D 并向其添加 ColorCube。它运行良好。 PS 我们的开发快照包括所有 dll、jar 和运行的 jre。我们记录所有库和 jvm 版本,它们在从开发快照和已安装的应用程序生成的日志中完全相同。我们使用 java.exe 的显式路径 (..\jre\bin\java.exe) 运行,因此 PATH 变量不起作用。

我正在寻找调试这个的想法。我想编写一个简单的 java 应用程序来打印所有 GL 属性,尤其是 GL_VERSION,以尝试演示两种设置之间的一些可量化的差异。 java3d 文档没有涵盖这一点,并且所有有关 GL_VERSION 问题的互联网搜索都只是告诉您更新驱动程序。

哦,我有 Nvidia Quadro FX 3800 卡。实际上是两个。

总而言之...
Q1:如何为 java3d 应用程序打印 GL_VERSION?
Q2:这到底是怎么回事?

I'm working on a 3d globe application written in java using java3d for the rendering. I've got a windows installer that basically copies files from a development snapshot to the program files directory. It runs fine from the devel snapshot, but when running after an install it does this:

Java 3D ERROR : OpenGL 1.2 or better is required (GL_VERSION=1.1)  
javax.media.j3d.IllegalRenderingStateException: GL_VERSION  
    at javax.media.j3d.NativePipeline.createNewContext(Native Method)  
    at javax.media.j3d.NativePipeline.createNewContext(NativePipeline.java:2736)  
    at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:4895)  
    at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:2421)  
    at javax.media.j3d.Renderer.doWork(Renderer.java:895)  
    at javax.media.j3d.J3dThread.run(J3dThread.java:256)  

I've compared the all the libraries and jars in the development directories and the files are all exactly the same and none are missing. It's the weirdest thing. I've updated my graphics drivers (though they're clearly sufficient since things run fine from a devel snapshot). I've written a simple java3d app that is able to make a Canvas3D and add a ColorCube to it. It runs fine. P.s. our development snapshot includes all the dlls, jars, and the jre things run from. We log all the library and jvm versions and they're exactly the same in logs generated from the devel snapshot and the installed application. We run using an explicit path to java.exe (..\jre\bin\java.exe), so the PATH variable isn't in play.

I'm looking for ideas to debug this. I'd like to write a simple java app that prints all the GL attributes, especially GL_VERSION, to try to demonstrate some quantifiable difference between the two set ups. The java3d docs don't cover that, and all internet searches for GL_VERSION problems just tell you to update your drivers.

Oh, I've got Nvidia Quadro FX 3800 cards. Two of 'em actually.

In summary...
Q1: How do you print GL_VERSION for your java3d application?
Q2: What the heck is going on?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

荒芜了季节 2024-08-19 21:07:14

在输入我的两个显卡后,我开始思考我最近如何从使用四个显示器切换到仅使用三个显示器,这样我就可以将第四个显示器用于我的新笔记本电脑。结果我们的应用程序在我的主文件夹中保存了一些属性,这些属性使我们的应用程序在第四个(现在不存在的)监视器上启动。看来java3d在不存在的屏幕空间中没有找到足够支持的opengl,并引发了上述异常。使用有效的屏幕坐标启动应用程序解决了这个问题。

After typing about my two graphics cards, I started thinking about how I recently switched from using four monitors to just three, so I could use the fourth for my new laptop. Turns our our application had saved some properties in my home folder that had our application starting up on the fourth, now non-existent monitor. It appears that java3d didn't find opengl sufficiently supported in non-existent screen space, and threw the above exception. Starting the application with valid screen coordinates solved the issue.

倾其所爱 2024-08-19 21:07:14

要检查 GL_VERSION,请在 Canvas3D 上使用 queryProperties() 方法。

String glVersion = (String)getCanvas3D().queryProperties().get("native.version");

但是这个错误并没有显示准​​确的 OpenGL 版本,使用上面的代码你可能会发现你的 GL_VERSION 不是像堆栈跟踪中那样的 1.1(我在安装 OpenGL 1.5 时也遇到了同样的错误)。

to check GL_VERSION use queryProperties() method on your Canvas3D.

String glVersion = (String)getCanvas3D().queryProperties().get("native.version");

But this error does not display the accurate version of OpenGL, using the code above you will likely see that you're GL_VERSION is not 1.1 like in the stacktrace (I had same error with OpenGL 1.5 installed).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文