Skip to main content

JCanvas3D

6 replies [Last post]
muralithefun
Offline
Joined: 2010-09-04

Hi All,

In my application i am using JCanvas3D.While loading i am getting an error message "Fail to lock surface: D3DERR_DRIVERINTERNALERROR".Anybody knows about this.My default renderer is OGL.My system softwares and drivers are uptodate.Pls it's very important and urgent.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
aces
Offline
Joined: 2003-07-17

Seens it is using D3D renderer.
Force OpenGL by adding the following at cmd line

-Dj3d.rend=OGL -Dsun.java2d.noddraw=true

the last one is not mandatory, but avoid using D3D by swing api.

muralithefun
Offline
Joined: 2010-09-04

i've done what you are saying..but it's not displaying the JCanvas3D and it's throwing the same error again.I used dj3d.debug=true and it has given the following details..

Java 3D 1.5.1, Windows version is 5.1 Build: 2600, Windows NT/2000/XP Service Pack 3
[Display Driver] igxprd32.dll, Intel(R) 4 Series Internal Chipset, Product 6
Version 14.10, Build 5009, VendorId 32902
DeviceId 32902, SubSysId 11794, Revision 41881640
[Desktop Mode] 1280x1024 60 MHz, D3DFMT_X8R8G8B8
[Device] Transform & Light Hardware Rasterizer
[Device] Reference Rasterizer (AA)

[Java3D]: using d3dVertexProcess=software
[Java3D]: Use Intel(R) 4 Series Internal Chipset, Hardware Rasterizer

[Java3D]: Create device :
Window 1253x781 D3DFMT_X8R8G8B8, handle=10014, MultiSampleType D3DMULTISAMPLE_NO
NE, SwapEffect D3DSWAPEFFECT_COPY, AutoDepthStencilFormat: D3DFMT_D24S8
Max Texture Unit Stage support : 8
Max Simultaneous Texture unit support : 8
Fail to lock surface: D3DERR_DRIVERINTERNALERROR
Fail to lock surface: D3DERR_DRIVERINTERNALERROR

muralithefun
Offline
Joined: 2010-09-04

and i also want to know why you are saying to avoid D3D for swing api.

aces
Offline
Joined: 2003-07-17

Your application is using D3D renderer. JCanvas works better with OpenGL.
Check if your desktop is using 32bit colors.
Also try to run other Java3D applications, just to check-out.

Make sure you have latest video drivers, and your video subsystem has, at least, 16MB of RAM.

>and i also want to know why you are saying to avoid D3D for swing api
On some systems, with old hardware/old video drivers, Swing API may fail when using DirectDraw or some D3D functions. GUI Flicker is one of this bad behavior.

muralithefun
Offline
Joined: 2010-09-04

i've experimented many things, while running from wizard it's working fine and it also shows the render as ogl but if i run my application from batch it's taking only directX,it's not taking the argument -Dj3d.rend=ogl.

tmilard
Offline
Joined: 2004-03-25

> i've experimented many things, while running from
> wizard it's working fine and it also shows the render
> as ogl but if i run my application from batch it's
> taking only directX,it's not taking the argument
> -Dj3d.rend=ogl.

((( post url : http://forums.java.net/jive/message.jspa?messageID=379641 )))
My experience ... See at the end of the post I said this n°4 OpenGl/switch/DirectX conclusion I,had:

--------------------------------------------------
4) Do not try to do this in JNLP with java virtual machine (JVM) parameters
Why ?
- It is unreadable,
- it externalise important code outside your java code,
- and it is a mess to maintain.
- and overall I am not did not manage to see it work

For example I personnally tried this in JNLP,file:
...

Result : Sadly I allways had OpenGl running. So my advise : Stick to java code to control java3d rendering platform
--------------------------------------------------

Here is the example of the java code that does the same as JNLP (but easier to debug).
Important in my memory : Do not forget to make it static otherwyse I think as soon as java VM sees Canvas3D it switch to the defaut renderer :

--------------------------------------------------
public class LaVisitePlayerApplet extends JApplet implements ..... {

static{
try{
String local_os_name = System.getProperty("os.name");

System.out.println("local_os_name="+local_os_name);
if (local_os_name.equalsIgnoreCase("Windows XP")) {
// Cas Windows XP :
System.out.println("local os XP ==> On me le renderer à 'ogl' ");
System.setProperty("j3d.rend", "ogl");
} else if (local_os_name.equalsIgnoreCase("Windows Vista")) {
// Cas Windows XP :
System.out.println("local os Vista ==> On met le renderer à 'd3d' ");
System.setProperty("j3d.rend", "d3d");
}
//---------------------
else if (local_os_name.equalsIgnoreCase("Windows 7")) {
// Cas Windows 7 :
System.out.println("local os 7 ==> On met le renderer à 'd3d' ");
System.setProperty("j3d.rend", "d3d");
}
//---------------------
else {
// Cas ????? (ni Windows XP, ni Vista) :
System.out.println("local os ???==> No renderer(??) ");
}

}catch(Throwable th){
System.err.println("Failed to set D3D-or-OpenGl as renderer for Java3D");
th.printStackTrace();
}
} // fin static

Hope it helps.
Thierry