Cg and CgFX are my favorite tools for shaders. However, i’ve just started to use the package com.sun.opengl.cg and there are bugs everywhere! :(. Does anyone else have this problem?
i never used the cg package before, but if you find a bug in jogl and post a detailed bugreport and testcase here, it will probably be fixed very quickly.
hello, hanks for the reply. Well, this is the most common bug I find:
(0) : fatal error C9999: *** exception during compilation ***
Cg compiler terminated due to fatal error
Java Result: 15
The wear is when it happens. I run the applet, I modify some parameters and the drawing is correct. But after a secons of playing I get that error. Why the compiler is being called?. This is the link to download the NetBeans project from my 4Shared account:
http://www.4shared.com/file/32864598/7d4985b5/CgFX-JOGL.html
Also I’ve been having some segmentation faults. If I add this lines of code at the beginning of the SimpleJOGL demo, I get a “Java Error 139”(but i do’nt see this error since I installed Cg2.0)
contextoCg = CgGL.cgCreateContext();
CgGL.cgGLRegisterStates(contextoCg);
efecto = CgGL.cgCreateEffectFromFile(contextoCg, "CelShading.cgfx", null);
tecnica = CgGL.cgGetFirstTechnique(efecto);
parametro = CgGL.cgGetFirstEffectParameter(efecto);
if(efecto != null){
System.out.println("Se cargo el efecto");
}else {
System.out.println("No se encontro el efecto, se continua con la aplicación");
}
int j=0;
String parameterName;
int parameterClassType;
String parameterTypeName;
while( parametro!=null){
parameterClassType = CgGL.CG_PARAMETERCLASS_UNKNOWN;
parameterTypeName = "Unknown";
j++;
parameterName = CgGL.cgGetParameterName( parametro);
System.out.println("Parametro nº "+j+" conocido como: "+parameterName );
parameterClassType = CgGL.cgGetParameterClass(parametro);
switch( parameterClassType){
case CgGL.CG_PARAMETERCLASS_SCALAR : parameterTypeName = "Escalar"; break;
case CgGL.CG_PARAMETERCLASS_VECTOR: parameterTypeName = "Vector"; break;
case CgGL.CG_PARAMETERCLASS_MATRIX : parameterTypeName = "Matriz"; break;
case CgGL.CG_PARAMETERCLASS_STRUCT : parameterTypeName = "Estructura"; break;
case CgGL.CG_PARAMETERCLASS_ARRAY : parameterTypeName = "Arreglo"; break;
case CgGL.CG_PARAMETERCLASS_SAMPLER : parameterTypeName = "Sampler"; break;
case CgGL.CG_PARAMETERCLASS_OBJECT : parameterTypeName = "Objeto"; break;
case CgGL.CG_PARAMETERCLASS_UNKNOWN : parameterTypeName = "Desconocido"; break;
default: parameterTypeName = "WEAR!";
}
System.out.println("El parametro es de clase: "+parameterTypeName);
parametro = CgGL.cgGetNextParameter(parametro);
}
int tecnicas =0;
int pases = 0;
String techniqueName, passName;
while(tecnica != null){
tecnicas++;
techniqueName = CgGL.cgGetTechniqueName(tecnica);
System.out.println("Tecnica nº "+tecnicas+" conocida como: "+techniqueName );
pase = CgGL.cgGetFirstPass(tecnica);
while(pase!=null){
pases++;
passName = CgGL.cgGetPassName(pase);
System.out.println("Pase nº "+pases+" en técnica " +techniqueName+ " se llama: " +passName );
pase = CgGL.cgGetNextPass(pase);
}
tecnica = CgGL.cgGetNextTechnique(tecnica);
}
Bye
I just try my application on a Windows mahcine and I dont see more errors.