• 9
• 9
• 11
• 12
• 9
• Similar Content

• Good evening everyone!

I was wondering if there is something equivalent of  GL_NV_blend_equation_advanced for AMD?
Basically I'm trying to find more compatible version of it.

Thank you!

• Hello guys,

How do I know? Why does wavefront not show for me?
I already checked I have non errors yet.

And my download (mega.nz) should it is original but I tried no success...
- Add blend source and png file here I have tried tried,.....

PS: Why is our community not active? I wait very longer. Stop to lie me!
Thanks !

• I wasn't sure if this would be the right place for a topic like this so sorry if it isn't.
I'm currently working on a project for Uni using FreeGLUT to make a simple solar system simulation. I've got to the point where I've implemented all the planets and have used a Scene Graph to link them all together. The issue I'm having with now though is basically the planets and moons orbit correctly at their own orbit speeds.
I'm not really experienced with using matrices for stuff like this so It's likely why I can't figure out how exactly to get it working. This is where I'm applying the transformation matrices, as well as pushing and popping them. This is within the Render function that every planet including the sun and moons will have and run.
if (tag != "Sun") { glRotatef(orbitAngle, orbitRotation.X, orbitRotation.Y, orbitRotation.Z); } glPushMatrix(); glTranslatef(position.X, position.Y, position.Z); glRotatef(rotationAngle, rotation.X, rotation.Y, rotation.Z); glScalef(scale.X, scale.Y, scale.Z); glDrawElements(GL_TRIANGLES, mesh->indiceCount, GL_UNSIGNED_SHORT, mesh->indices); if (tag != "Sun") { glPopMatrix(); } The "If(tag != "Sun")" parts are my attempts are getting the planets to orbit correctly though it likely isn't the way I'm meant to be doing it. So I was wondering if someone would be able to help me? As I really don't have an idea on what I would do to get it working. Using the if statement is truthfully the closest I've got to it working but there are still weird effects like the planets orbiting faster then they should depending on the number of planets actually be updated/rendered.

• Hello everyone,
I have problem with texture

• Hello everyone
For @80bserver8 nice job - I have found Google search. How did you port from Javascript WebGL to C# OpenTK.?
I have been searched Google but it shows f***ing Unity 3D. I really want know how do I understand I want start with OpenTK But I want know where is porting of Javascript and C#?

Thanks!

OpenGL Android + OpenGL ES...double buffered? threaded? gameloop?

This topic is 2174 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

3 questions...but first, here's my setup

My activity class:
 ...useless stuff... import android.opengl.GLSurfaceView; public class MyApp extends Activity { private GLSurfaceView mSurfaceView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); //fullscreen getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); glSurfaceView = new GLSurfaceView(this); glSurfaceView.setRenderer(new MyRenderer()); setContentView(glSurfaceView); } } 

My Renderer class
 ...unimportant stuff... import android.opengl.GLSurfaceView.Renderer; public class MyRenderer implements Renderer { @Override public void onDrawFrame(GL10 gl) { ...iterate over draw objects and call .draw() on them... } } ...more unimportant stuff... 

1) Is OpenGL ES double buffered by default?
Right now, I've created a Renderer class that extends GLSurfaceView.Renderer. From that, I've got an override for onDrawFrame...like you can see above. Is this already double buffered? I've done a little bit of OpenGL coding for PC and I remember having to specifically tell it to swap buffers...

2) Given my current setup, is the renderer already on its own thread? Is that something handled by OpenGL ES (or the GLViewPort class)?

3) Right now I'm doing everything inside of the onDrawScene(GL10 gl) function. Is there a better way of creating a game loop? Seems like (assuming rendering is currently on its own thread), onDrawScene should just iterate of my drawable objects and draw them, but I should probably have a loop in another thread somewhere polling input, updating drawable object positions, etc. Any thoughts?

Thanks, in advance, for the help!

[Edit: spelling error] Edited by Holland

Share on other sites
AFAIK Android uses EGL. So it all depends on what the Java crap is doing under the hood to initialize your EGL content.

You could either dig into the Android codebase (ugly, full of hacks) or just ditch Java and take control by doing all the initialization with your own code in C++.

Share on other sites
1) OpenGL ES isn't double buffered by default, but GLSurfaceView uses double buffering in your configutration (eglSwapBuffer is called automatically). you can change this behaviour if you call setRenderMode(RENDERMODE_WHEN_DIRTY), now you can force swapbuffer yourself by calling requestRender() (Look at GLSurfaceView on the reference page)

Tripple Buffering is also possible, look for the video about OpenGL developing from the last google IO. The guy explains how to use triple buffering for benchmarking purposes (with double buffering most devices have a fixed output of 30 / 60 fps)

2) The renderer is indeed on its own thread, GLSurfaceView starts the Thread after setRenderer() get's called. I've rewritten this class for Wallpaper-rendering with OpenGL ES 2.0 and took a deeper look. GLSurfaceView does all the EGL things with the more complicated android stuff for your, handling the RenderThread, Managnig the EGLContext (important because of the different behaviours on different devices, when other activities need a lock on the EGLContext - not trivial to manage this on your own)

3) I've choosen the way to build up two extra Threads for my current developments (one for logic, one for animations, several others are launched by android like SensorThread for polling accelerometer). In general I could say these things:
- don't do heavy work on androids UIThread, which isn't the case if you do it in onDrawFram() because now its done by the renderThread
- if you do heavy work like IO-operations use a ASyncTask
- its hard to implement extra threads in the java manner (new Thread and calling run() ) because you have to take care of the whole synchronizing and more care on
bringing your Threads to idle-state if your activity is paused (or you app is a battery drainer). This isn't the preferable way as long as you haven't performance problems while using the render-thread

Avoid using native code, except you have to (ready c / c++ implemantations) - the dalvik vm is really fast, especially since it uses a JIT-Compiler (since API-Level 8 I think).
You still have to call your c/c++ written wrapper methods through JAVA (with JNI / NDK), nothing else the Android-API is doing So you don't have a performance increase, except your logic is handled here and you make use of special ARM CPU features like the NEON-platform or similar things

Look a christmas 3D on android market, if your device can handle it you'll see 2 things