Calling gl ES 2.0 functions.

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
jazz
Posts: 16
Joined: Sun Mar 24, 2013 2:46 am

Calling gl ES 2.0 functions.

Post by jazz »

As I understand it, calling ES 2.0 functions are not yet supported correct? Also a mesh is rendered as a VBO. Is there a way to explicit specify vertices for a mesh, say with (GL_TRIANGLES)?

I'm trying to draw a mesh many times with an offset. But I'm thinking it would be better performance to just repeat the vertices and offsets(as vertices) in one mesh declaration instead of constantly calling the rendering of a small mesh many times sending the offsets to the shader. This the way I was doing it in android ndk project. How could I do something similar with ZGE.

Maybe I can do an expression that that create a the mesh multiple times modifying the offset(vertices) and then combines the meshes together using mesh combine, not sure if it can be used that way.

Thanks, any advice/help.

-Jazz
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Hi Jazz,

You can achieve this with the MeshLoop component.

For an example, try copying the text below and paste into the Content node in ZGE.

Code: Select all

ZZDC<?xml version="1.0" encoding="iso-8859-1" ?>
<Mesh Name="Mesh1">
  <Producers>
    <MeshLoop Scale="1.1 1.1 1.1" Count="5" Position="0.25 0.25 0.25">
      <OnIteration>
        <MeshSphere/>
      </OnIteration>
    </MeshLoop>
  </Producers>
</Mesh>
Also, if you want to make direct GL calls: right click in tree, select Add from library, then External Libaries - OpenGL 4.0 graphics. This is the full 4.0 API but all the GL ES 2.0 calls should be included there.
jazz
Posts: 16
Joined: Sun Mar 24, 2013 2:46 am

Post by jazz »

Thanks VilleK.

Exactly what I was looking for. In regards to GL ES 2.0 calls, I took a look at opengl.txt, yep they're there.(doh)

Excellent tool btw.

-jazz
Post Reply