Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile fine but Not able to run demos #15

Open
JimSEOW opened this issue Oct 10, 2015 · 11 comments
Open

Compile fine but Not able to run demos #15

JimSEOW opened this issue Oct 10, 2015 · 11 comments

Comments

@JimSEOW
Copy link

JimSEOW commented Oct 10, 2015

        SSAssetManager.AddAssetArchive(new SSAssetArchiveHandler_FileSystem("./Assets"));
            SSAssetManager.AddAssetArchive(new SSAssetArchiveHandler_FileSystem("../../Assets"));
            SSAssetManager.AddAssetArchive(new SSAssetArchiveHandler_FileSystem("../../../Assets"));
            SSAssetManager.AddAssetArchive(new SSAssetArchiveHandler_FileSystem("../../../../Assets"));
            SSAssetManager.AddAssetArchive(new SSAssetArchiveHandler_FileSystem("../../../DemosCommon/Assets"));

            mainShader = new SSMainShaderProgram(); // before mscene
            if (!mainShader.IsValid) {
                throw new Exception ("Failed to build the main shader");
            }

open in visual studio. Compile all. Fine.
GDiviaAGGTest works fine
But all TestBench fails at this stage
=> throw new Exception

@JimSEOW
Copy link
Author

JimSEOW commented Oct 10, 2015

'System.BadImageFormatException' occurred in mscorlib.dll

Additional information: Could not load file or assembly 'TestBenchCommon, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

@JimSEOW
Copy link
Author

JimSEOW commented Oct 10, 2015

GL Version = 4.2.0 - Build 10.18.10.3383
GL Shader Version = 4.20 - Build 10.18.10.3383
-- ss4_vertex.glsl --

-- ss4_fragment.glsl --

-- ss4_geometry.glsl --
ERROR: 0:14: 'dist' : geometry shader input varying variable must be declared as an array

noperspective varying vec3 dist;
ERROR: 0:22: '' : inconsistent qualifiers: storage
varying in vec3 VV[3];
ERROR: 0:23: '' : inconsistent qualifiers: storage
varying in vec3 vertexNormal[3];
ERROR: 0:24: '' : inconsistent qualifiers: storage
varying in vec3 lightPosition[3];
ERROR: 0:25: '' : inconsistent qualifiers: storage
varying in vec3 eyeVec[3];
ERROR: 0:26: '' : inconsistent qualifiers: storage
varying in vec3 vertexPosition_objectspace[3];
ERROR: 0:27: '' : inconsistent qualifiers: storage
varying in vec4 shadowMapCoords[3][MAX_NUM_SMAP_SPLITS];
ERROR: 0:33: 'varying out' : supported in fragment shaders only
varying out vec3 f_VV;
ERROR: 0:34: 'varying out' : supported in fragment shaders only
varying out vec3 f_vertexNormal;
ERROR: 0:35: 'varying out' : supported in fragment shaders only
varying out vec3 f_lightPosition;
ERROR: 0:36: 'varying out' : supported in fragment shaders only
varying out vec3 f_eyeVec;
ERROR: 0:37: 'varying out' : supported in fragment shaders only
varying out vec3 f_vertexPosition_objectspace;
ERROR: 0:38: 'varying out' : supported in fragment shaders only
varying out vec4 f_shadowMapCoords[MAX_NUM_SMAP_SPLITS];
ERROR: 0:43: 'varying out' : supported in fragment shaders only
varying out vec3 surfaceLightVector;
ERROR: 0:44: 'varying out' : supported in fragment shaders only
varying out vec3 surfaceViewVector;
ERROR: 0:45: 'varying out' : supported in fragment shaders only
varying out vec3 surfaceNormalVector;
ERROR: 0:47: 'varying out' : supported in fragment shaders only
noperspective varying out vec3 f_dist;
ERROR: 0:94: 'surfaceLightVector' : undeclared identifier
surfaceLightVector = normalize(tangentSpaceMatrix * lightPosition[i]);
ERROR: 0:94: 'assign' : cannot convert from '3-component vector of float' to 'float'
surfaceLightVector = normalize(tangentSpaceMatrix * lightPosition[i]);
ERROR: 0:95: 'surfaceViewVector' : undeclared identifier
surfaceViewVector = normalize(tangentSpaceMatrix * eyeVec[i]);
ERROR: 0:95: 'assign' : cannot convert from '3-component vector of float' to 'float'
surfaceViewVector = normalize(tangentSpaceMatrix * eyeVec[i]);
ERROR: 0:96: 'surfaceNormalVector' : undeclared identifier
surfaceNormalVector = normalize(tangentSpaceMatrix * vertexNormal[i]);
ERROR: 0:96: 'assign' : cannot convert from '3-component vector of float' to 'float'
surfaceNormalVector = normalize(tangentSpaceMatrix * vertexNormal[i]);
ERROR: 0:99: 'f_dist' : undeclared identifier
f_dist = vertexEdgeDistance[i];
ERROR: 0:99: 'assign' : cannot convert from '3-component vector of float' to 'float'
f_dist = vertexEdgeDistance[i];
ERROR: 0:102: 'f_VV' : undeclared identifier
f_VV = VV[i];
ERROR: 0:102: 'assign' : cannot convert from '3-component vector of float' to 'float'
f_VV = VV[i];
ERROR: 0:103: 'f_vertexNormal' : undeclared identifier
f_vertexNormal = vertexNormal[i];
ERROR: 0:103: 'assign' : cannot convert from '3-component vector of float' to 'float'
f_vertexNormal = vertexNormal[i];
ERROR: 0:104: 'f_lightPosition' : undeclared identifier
f_lightPosition = lightPosition[i];
ERROR: 0:104: 'assign' : cannot convert from '3-component vector of float' to 'float'
f_lightPosition = lightPosition[i];
ERROR: 0:105: 'f_eyeVec' : undeclared identifier
f_eyeVec = eyeVec[i];
ERROR: 0:105: 'assign' : cannot convert from '3-component vector of float' to 'float'
f_eyeVec = eyeVec[i];
ERROR: 0:106: 'f_vertexPosition_objectspace' : undeclared identifier
f_vertexPosition_objectspace = vertexPosition_objectspace[i];
ERROR: 0:106: 'assign' : cannot convert from '3-component vector of float' to 'float'
f_vertexPosition_objectspace = vertexPosition_objectspace[i];
ERROR: 0:112: '[' : built-in array must be redeclared with a size before being indexed with a variable
gl_TexCoord[0] = gl_TexCoordIn[i][0];

** Shader Compile Failed **
The fragment shader uses varying f_vertexNormal, but previous shader does not write to it.
The fragment shader uses varying f_VV, but previous shader does not write to it.
The fragment shader uses varying f_shadowMapCoords, but previous shader does not write to it.
The fragment shader uses varying f_vertexPosition_objectspace, but previous shader does not write to it.
The fragment shader uses varying f_eyeVec, but previous shader does not write to it.
The fragment shader uses varying surfaceLightVector, but previous shader does not write to it.
The fragment shader uses varying surfaceViewVector, but previous shader does not write to it.
The fragment shader uses varying f_dist, but previous shader does not write to it.

GL Error: InvalidValue

@jeske
Copy link
Owner

jeske commented Oct 10, 2015 via email

@JimSEOW
Copy link
Author

JimSEOW commented Oct 12, 2015

windows 8.1 on laptop which is less than 1 year old.
I doubt hardware issues as I regularly compile and run many different OpenTK or SharpGL projects

It would be great to be able to just download and unzip the file, compile and run to see how the demo look without further debugging.

@jeske
Copy link
Owner

jeske commented Oct 13, 2015 via email

@JimSEOW
Copy link
Author

JimSEOW commented Oct 13, 2015

Nvidia GeForce GTX 780M
I was looking for ideas on how to implement scence graph. This project is suitable for this purpose. Good JOb

I tested
https://github.com/Namone/SimpleScene

I removed this line

        //checkErrors();

in SSMainShaderProgram.cs

The WavefrontOBJViewer program works!!!

SSShaderProgram.cs
protected void checkErrors() {
ErrorCode glerr;
if ((glerr = GL.GetError ()) != ErrorCode.NoError) {
throw new Exception (String.Format ("GL Error: {0}", glerr));
}
}

@jeske
Copy link
Owner

jeske commented Oct 14, 2015

My NVidia drivers don't throw those shader errors. Does your laptop have dual-graphics? Those errors look more like the kind of things I see out of intel drivers (which are less forgiving)

Namone/SimpleScene is just an old version before we added lots of other features.

You can try to make our latest tree work by forcing the geometry shader off... In SSMainShaderProgram.cs, SSMainShaderProgram, change this line:

if (GL.GetString(StringName.Extensions).ToLower().Contains("gl_ext_gpu_shader4")) {

to this:

if (false && GL.GetString(StringName.Extensions).ToLower().Contains("gl_ext_gpu_shader4")) {

... We should change this code so if the SS4 shader compile fails it just falls back to the SS1 shader automatically.

@jeske
Copy link
Owner

jeske commented Oct 14, 2015

Can you try the latest ( https://github.com/jeske/SimpleScene ) ?

I put some code into the shader load to automatically fall back to the simpler SS1 shader if the SS4 shader load fails. I'd like to know if this fixes your startup problem.

NOTE: this isn't really the best "fix" because we also want the SS4 shader to load on your hardware, but I need to get access to a setup that causes the problem to fix this.

@JimSEOW
Copy link
Author

JimSEOW commented Oct 15, 2015

Does your laptop have dual-graphics?
YES. it switches between intel ( Intel HD Graphics 4000 + ) and Nvidia.

Perhaps this could be the common issue. Perhaps you could notify new user to take this into consideration when running this stimulating project

@jeske
Copy link
Owner

jeske commented Oct 18, 2015

Dave - can you try the latest version and let us know if it works?

@JimSEOW
Copy link
Author

JimSEOW commented Oct 19, 2015

I still think it is important that people know https://github.com/Namone/SimpleScene (a version for beginner to immediately test OpenTK scene graph).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants