opengl-es

android OpenGl How to draw a rectangle

最后都变了- 提交于 2020-07-17 17:33:25
问题 I wnat to draw a rectangle using opengl. package jnidemo.example.com.openglsquare; import android.content.Context; import android.opengl.GLSurfaceView; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.ShortBuffer; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10;

what does instancing do in webgl

你离开我真会死。 提交于 2020-07-07 05:07:32
问题 I want to know is any way to understand how many times vertex shader will be called in a draw call in webgl? because I want to know what does instancing realy do, is it call every shared vertices for each instance? so it will call too many time vertex shader 回答1: Instancing calls your vertex shader one per vertex per instance. The difference is you can choose 1 or more attributes to only advance once per instance instead of once per vertex. Normally each attribute advances stride bytes for

How to render objects in Just A Line AR App?

吃可爱长大的小学妹 提交于 2020-06-27 01:10:05
问题 I have to render objects over lines drawn in Just a Line AR App .But when i am trying to include arfragment, " app is not able to find a place to draw line ".Also when i am trying to include view renderable class for showing 2d texts into 3d scene,i am getting this error: "No implementation found for long com.google.android.filament.Stream.CreateBuilder()". Any idea on how to resolve this issue? 来源: https://stackoverflow.com/questions/62592904/how-to-render-objects-in-just-a-line-ar-app

Passing values between SCNShadable entry points

两盒软妹~` 提交于 2020-06-25 18:04:27
问题 In an OpenGL program you typical declare something like this in a vertex shader varying bool aBooleanVariable; and then read the value in the fragment shader. How do you do this within the framework of an SCNShadable entry point? For example from SCNShaderModifierEntryPointGeometry to SCNShaderModifierEntryPointFragment . Receiving the argument seems to be defined by using the pragma arguments, I provide my test SCNShaderModifierEntryPointFragment to illustrate. #pragma arguments bool

iOS/Metal: how to read from the depth buffer at a point?

允我心安 提交于 2020-06-24 16:47:06
问题 I'd like to read from the depth buffer. In GL on OS X I could do: float depth[2][2]; // get 2x2 for bilinear interpolation glReadPixels(s.x, s.y, /*width*/2, /*height*/2, GL_DEPTH_COMPONENT, GL_FLOAT, depth); (Note that with OpenGL ES on iOS you can't read from the depth buffer) What's the equivalent with Metal? It looks like I need to do: _renderPassDescriptor.depthAttachment.storeAction = MTLStoreActionStore; And then somehow read from the buffer via the CPU? Though perhaps there's a better

Are Android Views backed by OpenGL?

♀尐吖头ヾ 提交于 2020-06-17 09:10:47
问题 Do native Android views (View class and everything that extends it, i.e. TextView, ImageView, etc...) , use OpenGL under the hood? If not, are there any advantages to using OpenGL to the average Android Developer as opposed to using the regular views for custom UI components? 回答1: Do native Android views (View class and everything that extends it, i.e. TextView, ImageView, etc...), use OpenGL under the hood? Basically yes, OpenGL ES is the API used by the display hardware system to draw

Are Android Views backed by OpenGL?

随声附和 提交于 2020-06-17 09:10:46
问题 Do native Android views (View class and everything that extends it, i.e. TextView, ImageView, etc...) , use OpenGL under the hood? If not, are there any advantages to using OpenGL to the average Android Developer as opposed to using the regular views for custom UI components? 回答1: Do native Android views (View class and everything that extends it, i.e. TextView, ImageView, etc...), use OpenGL under the hood? Basically yes, OpenGL ES is the API used by the display hardware system to draw

How can I find a list of all the uniforms in OpenGL es 2.0 vertex shader pro

喜你入骨 提交于 2020-06-09 17:07:05
问题 I'm trying to learn how to program vertex shaders. In Apple's sample project they have a line to set a glUniform1f(uniforms[UNIFORM_TRANSLATE], (Glfloat)transY); Then this value is used in // value passt in f // glUniform1f(uniforms[UNIFORM_TRANSLATE](Glfloat)transY); uniform float translate; void main() { gl_Position.y+=sin( translate); … I was unable to find a list of all uniforms of all the uniforms. Does any one know where I can find a list of all the uniforms and a good book or tutorial

How to redraw partially in opengl Es 2.0

雨燕双飞 提交于 2020-05-31 05:28:27
问题 As per my need I want to redraw only some part of the scene for each frame instead of redrawing the entire scene only if some portion of it is updated. Is there a way to do that in OpenGL ES 2.0? Please any input on this will be really helpful 回答1: OpenGL does not really support incremental rendering. You need to draw the entire frame every time you are asked to redraw. The closest I can think of is that you render your static data to an offscreen framebuffer, using a FBO (Frame Buffer Object

How to enable Anti-aliasing in Moderngl EGL backend?

泪湿孤枕 提交于 2020-05-30 19:19:32
问题 This code renders a colored triangle when there is no anti-aliasing ( samples=0 ). But when I turn on anti-aliasing ( samples=1...32 ) it can't render anything. How to make it work with anti-aliasing? Perhaps I cannot read pixels from multisample fbos or textures directly but I don't know how to fix that. import numpy as np from PIL import Image import moderngl ctx = moderngl.create_standalone_context(backend='egl') fbo = ctx.framebuffer( color_attachments=ctx.texture((512, 512), 4, samples=2