Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6759663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:58:22+00:00 2026-05-26T13:58:22+00:00

i currently trying to get my model loader to work and got a error

  • 0

i currently trying to get my model loader to work and got a error when binding new shader attributes.

At this point i would post the error message, but MonoTouch don’t let me do this. The only thing i got is “WARNING: Could n”, seems to be a issue with MonoTouch, because i used a template of the framework.

Here is the shader code:

<Shader>
  <Uniforms>
    <Uniform type="mat4" name="modelViewMatrix"/>
  </Uniforms>

  <Vertex>
    <Attributes>
      <Attribute type="vec3" name="position" binding="Position"/>
      <Attribute type="vec3" name="normal" binding="Normals"/>
      <!--<Attribute type="vec4" name="color" binding="Color"/>-->
    </Attributes>

    <Code><![CDATA[

attribute vec3 position;
attribute vec3 normal;          

varying vec4 colorVarying;

uniform mat4 modelViewMatrix;           

void main()
{
  gl_Position = modelViewMatrix * vec4(position.xyz, 1.0);
  float z = gl_Position.z / 100.0;
  colorVarying = vec4(z, z, z, 1.0) ;   
}

    ]]></Code>
  </Vertex>
  <Pixel>
    <Code><![CDATA[

varying lowp vec4 colorVarying;

void main()
{
  gl_FragColor = colorVarying;
}

    ]]></Code>
  </Pixel>
</Shader>

The shader works perfectly when removing the “normal” attribute. When adding it i got the following error from mono ( Not from OpenGL ) after calling GL.LinkProgram:

App(553,0xacb752c0) malloc: *** error for object 0x1025a3c4: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

I noticed that it has something to do with the attribute binding. Here is the code:

// Bind attribute locations
for (int i = 0; i < _VertexAttributeList.Length; i++)
{
    ShaderAttribute attribute = _VertexAttributeList[i];
    GL.BindAttribLocation(_Program, i, attribute.Name);
}

When i replace “_VertexAttributeList.Length” with the constant 1 it works without any errors.

Cheers
Felix

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:58:22+00:00Added an answer on May 26, 2026 at 1:58 pm

    I found the error after using the following lines of code:

    for (int i = 0; i < _VertexAttributeList.Length) {
        ShaderAttribute attribute = _VertexAttributeList[i];
        Console.WriteLine("Attribute {0} @ {1}", attribute.Name,
                          GL.GetAttribLocation(_Program, attribute.Name));
    }
    

    It turns out that GLSL Ignores unused attributes and the attribute “normal” has a location of -1.

    It has been a very annoying error, because of the fact that i know now what the error message means which i could not read because of the MonoTouch error: “Variable not used and ignored”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently trying to get a UISlider to work. I'm trying to set the
i am currently trying to get Input Mode Editor (IME) support working with a
I'm currently trying to get into the Java EE development with the Spring framework.
I'm currently trying to get the output of an executable console-app into an other
I am currently trying to get data out of a plist. It basically looks
I'm currently trying to get a grip on Android development and working my way
Heya, I'm currently trying to get bltoolkit working in my project. I've added the
I am trying to get MSTest working with CruiseControl.Net. I currently have it working
I have been trying to get more in to TDD. Currently keeping it simple
I'm struggling a lot trying to get our build server going. I am currently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.