GithubHelp home page GithubHelp logo

Comments (10)

giawa avatar giawa commented on September 15, 2024

Are you able to provide your shader source?

from opengl4csharp.

TheRealNOIG avatar TheRealNOIG commented on September 15, 2024

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.

giawa avatar giawa commented on September 15, 2024

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:

temp

Is it possible there is something else using a standard VAO somewhere?

from opengl4csharp.

TheRealNOIG avatar TheRealNOIG commented on September 15, 2024

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.

TheRealNOIG avatar TheRealNOIG commented on September 15, 2024

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.

TheRealNOIG avatar TheRealNOIG commented on September 15, 2024

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.

TheRealNOIG avatar TheRealNOIG commented on September 15, 2024

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.

giawa avatar giawa commented on September 15, 2024

Does it appear to only happen when you load shaders from resources?

from opengl4csharp.

TheRealNOIG avatar TheRealNOIG commented on September 15, 2024

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.

giawa avatar giawa commented on September 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.