Author Topic: Cpct?  (Read 10108 times)

Offline AGP

  • quad
  • ******
  • Posts: 1702
    • View Profile
Re: Cpct?
« Reply #120 on: April 20, 2021, 07:46:54 am »
I'm porting GLSLShader and ShadowHelper right now. Around line 382, ShadowHelper does world.setAmbientLight(col.getRed(), col.getRed(), col.getBlue()). Is that a bug or did you use red twice on purpose?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12187
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #121 on: April 20, 2021, 09:09:54 am »
Opps, no....that's supposed to be col.getGreen(). The Android version does is correctly though.

Offline AGP

  • quad
  • ******
  • Posts: 1702
    • View Profile
Re: Cpct?
« Reply #122 on: April 22, 2021, 09:01:40 pm »
This is what my renderVertexArray(int) method looks like, because I couldn't find OpenTK equivalents for the ARBMultitexture stuff. Could that be the problem?

Code: [Select]
       private void renderVertexArray(int curPos) {
              if (curPos != 0) {
                     bool dissed = false;
                     // For Projective the texture coordinates from ...
                     for (int i = 0; i < projective.Length; i++) {
                            if (projective[i] && buffersEnabled[i]) {
//                                   ARBMultitexture.glClientActiveTextureARB(stageMap[i]);
                                   GL.DisableClientState(ArrayCap.TextureCoordArray);
                                   dissed = true;
                            }
                     }
                     GL.DrawArrays(PrimitiveType.Triangles, 0, curPos);
                     if (dissed) {
                            // And on again if required. Actually, this should be dead, but you are not in the driver.
                            for (int i = 0; i < projective.Length; i++) {
                                   if (projective[i] && buffersEnabled[i]) {
//                                          ARBMultitexture.glClientActiveTextureARB(stageMap[i]);
                                          GL.EnableClientState(ArrayCap.TextureCoordArray);
                                   }
                            }
                     }
              }
       }

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12187
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #123 on: April 23, 2021, 07:25:39 am »
I'm not sure what you mean, because there is ARBMultitexture-stuff in your code anyway. However, it might be worth a try and see if your constants are the same as they are in normal OpenGL. These should just be integers and if your toolkit isn't doing something really strange with them, something like PrimitiveType.Triangles should have the same value as OpenGL's GL_TRIANGLES.

Offline AGP

  • quad
  • ******
  • Posts: 1702
    • View Profile
Re: Cpct?
« Reply #124 on: April 23, 2021, 07:50:28 am »
The ARBMultitexture lines are commented out in the above code. But I found GL.ActiveTexture((TextureUnit)stageMap), which I hope is the same. Still, no progress on the vertex array problem. As for PrimtiveType.Triangles, I'm confident about it.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12187
    • View Profile
    • http://www.jpct.net
Re: Cpct?
« Reply #125 on: April 23, 2021, 09:18:32 am »
I see...it shouldn't matter much though, because it's only used for projective texturing, which in most cases, you don't need unless you are using shadow mapping and, well, projective textures.