Comments (10)
Are you able to provide your shader source?
from opengl4csharp.
I tested this in a environment that only has that code. Any working shader file (without a in vec3 in_position) gives this error.
Here is a minimal viable shader for testing
#version 330
uniform mat4 projection_matrix;
uniform mat4 view_matrix;
uniform mat4 transformation_matrix;
out vec3 color;
attribute vec3 position;
void main(void)
{
gl_Position = projection_matrix * view_matrix * transformation_matrix * vec4(position, 1);
color = vec3(position.x+0.5, position.z+0.5, position.y+0.5);
}
#version 330
in vec3 color;
void main(void)
{
gl_FragColor = vec4(color, 1);
}
from opengl4csharp.
I took your code above and made a new project, here's my Program.cs: https://gist.github.com/giawa/c6bfcfa4d2924e86a5af0fcff28dce33
This runs just fine and gives the following:
Is it possible there is something else using a standard VAO somewhere?
from opengl4csharp.
So I just got back into work and this just got more confusing. So when I started up the app without changing anything from yesterday the error went away. So I tried testing it by changing position
with other_position
and the error came back saying no variable position
but I already searched for that variable in my project and it has already been replaced everywhere in the code with other_position
. I am even printing out the string before I pass it to the shaderprogram and it shows the updated string.
from opengl4csharp.
So I think I found the issue. I am using Resources.resx to load in all my files and looking through the .Designer.cs file it shows that it has some of the old code for the txt files even though when I look at it in the resources.resx page it shows the new code.
I will close out this issue and keep looking into why the resources.resx is cashing old txt files.
from opengl4csharp.
BTW I wanted to note that it is not returning the old code but the summary of the get function has the old code in it which I think is messing with the shader compiler
Function called
/// <summary>
/// Looks up a localized string similar to #version 330
///
///uniform mat4 projection_matrix;
///uniform mat4 view_matrix;
///uniform mat4 transformation_matrix;
///
///out vec2 uv;
///
///in vec2 position;
///in vec2 in_uv;
///
///void main(void)
///{
/// gl_Position = projection_matrix * view_matrix * transformation_matrix * vec4(position, 0, 1);
/// uv = in_uv;
///}.
/// </summary>
public static string textured2DVertexShader {
get {
return ResourceManager.GetString("textured2DVertexShader", resourceCulture);
}
}
String returned
#version 330
uniform mat4 projection_matrix;
uniform mat4 view_matrix;
uniform mat4 transformation_matrix;
out vec2 uv;
in vec2 other_position;
in vec2 in_uv;
void main(void)
{
gl_Position = projection_matrix * view_matrix * transformation_matrix * vec4(other_position, 0, 1);
uv = in_uv;
}
from opengl4csharp.
Another note now it is completely fine with other_position but is now saying 'Shader did not contain 'in_uv'.' So I have no idea what is going on...
from opengl4csharp.
Does it appear to only happen when you load shaders from resources?
from opengl4csharp.
No. After more testing The issue was still happening and I was completely unable to debug the issue.
I did just create my own handler for shaders and shader program and everything is now working without issue.
Edit:
Im just going to pull OpenGL.Platform out of my project and switch over to FreeGlut or GLFW to allow for x64 on Windows and Linux support. Luckily over time Ive already been replacing parts of OpenGL.Platform and the only part im using now is creating the SDL2 window and the GenericVBO class.
from opengl4csharp.
Okay, sounds good. I've had really good luck with both GLFW and SDL2. Worth noting, GenericVBO isn't part of OpenGL.Platform, and it part of the OpenGL namespace. Good luck!
from opengl4csharp.
Related Issues (20)
- Unhandled Exception HOT 2
- Shader Uniform Arrays HOT 4
- VAO support for instanced drawing. HOT 3
- Unable to run on Linux with Mono HOT 8
- Create More than one screen HOT 1
- Glut Window Dimensions is not scaled to Vector2 or Vector3 HOT 9
- I cant render more than one of the same polygon using my algorithm HOT 6
- FileLoadException when starting program HOT 3
- rendering more than one shape with out writing them separately HOT 4
- How to subscribe key events to special keys? HOT 3
- Unhandled Exception when closing program HOT 5
- Fetching dotnetcore branch, not getting changes
- Adding Windows code to Gl class HOT 7
- Can't find anywhere else to ask this HOT 3
- Creating a .NET 5 branch, and making it the default branch. HOT 2
- Missing ImageSharp HOT 3
- ShaderProgram.Use() fails under multiple contexts. HOT 3
- Issues about OpenGL.dll file HOT 1
- animating a prism HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opengl4csharp.