Go to advanced search

by dattrax
Wed Dec 16, 2015 7:17 pm
Forum: OpenGLES
Topic: opengl resources release problem
Replies: 2
Views: 4079

Re: opengl resources release problem

You could try

eglReleaseThread()

Before you terminate. This should clear any bound but not deleted resources.
by dattrax
Wed Dec 16, 2015 7:09 pm
Forum: OpenGLES
Topic: Back buffer gets cleared?
Replies: 4
Views: 3223

Re: Back buffer gets cleared?

It's not really anything to do with tiled or immediate mode renderers, but more what the EGL speciation says when eglSwapbuffers is called. From the specification - The contents of ancillary buffers are always undefined after calling eglSwap- Buffers. The contents of the color buffer are undefined i...
by dattrax
Wed Dec 18, 2013 4:50 pm
Forum: OpenGLES
Topic: Anything special needed to make glBlendFuncSeparate work?
Replies: 2
Views: 2381

Re: Anything special needed to make glBlendFuncSeparate work

What API set are you using?

glBlendFuncSeparate() only works in ES2.0, not ES1.1.

Can you post some sample code showing the bug?
by dattrax
Mon Jul 29, 2013 11:23 pm
Forum: OpenGLES
Topic: Render to depth texture
Replies: 4
Views: 4069

Re: Render to depth texture

No direct access to save the depth buffer I'm afraid. You can pack the depth into a colour buffer (lots of games/benchmarks do this). Pi only has up to 24bits of depth so probably 3 channels would suffice. something along these lines http://smt565.blogspot.co.uk/2011/04/bit-packing-depth-and-normals...
by dattrax
Sat Dec 15, 2012 10:08 am
Forum: OpenGLES
Topic: RGB565 when RGB888 reqested
Replies: 11
Views: 3842

Re: RGB565 when RGB888 reqested

the values read back through colour picking STILL show 565 bits for RGB
What arguments are you using to glReadPixels()?

Jim
by dattrax
Fri Dec 14, 2012 1:22 pm
Forum: OpenGLES
Topic: RGB565 when RGB888 reqested
Replies: 11
Views: 3842

Re: RGB565 when RGB888 reqested

Q1) Does the GPU support 24 bit colour ? not really as a packed pixel format, you need to think of it as XBGR, 24valid bits in a 32bit word Q2) If so, how do I get EGL to give me a 24bit context ? EGL has a sort order for the configs returned. you need to do something like this if (!eglGetConfigs(p...
by dattrax
Fri Nov 23, 2012 4:13 am
Forum: Graphics programming
Topic: Basic questions about doing graphics on the Pi
Replies: 3
Views: 2266

Re: Basic questions about doing graphics on the Pi

I can write code in OpenGL and OpenGL ES. Is that true You need to stick to ES if you want any kind of hardware acceleration. if I pick an OpenGL ES for Android book I'll be able to use what I learn when coding on the Pi? depends. Android has two ways to develop. 1) NDK is basically C/C++ compiled ...
by dattrax
Sun Nov 18, 2012 2:54 am
Forum: OpenGLES
Topic: Fragment shader sometimes not working as expected.
Replies: 11
Views: 4879

Re: Fragment shader sometimes not working as expected.

I had a quick look at the driver code to get some explanation to the anomaly. in the vec4() case the arguments are considered constant and it runs via a separate code path. if you use vec4(1.0, 1.0, 1.0, 0.5) it shouldn't have an alpha of 0.5 as the alpha channel in this case is being forced to 1.0 ...
by dattrax
Fri Nov 16, 2012 3:51 pm
Forum: OpenGLES
Topic: Fragment shader sometimes not working as expected.
Replies: 11
Views: 4879

Re: Fragment shader sometimes not working as expected.

The v3d doesn't really support 24bit colour, only 8888 or 888X. The driver backend in the case of 24bit doesn't actually set the alpha channel, so it can be described as undefined. In 32bit it takes the alpha component from the texture. This is why when forcing it via the colour constant write, it b...
by dattrax
Mon Aug 27, 2012 9:04 am
Forum: Graphics programming
Topic: Drawing a 2D triangle with EGL and GLESv1
Replies: 5
Views: 3550

Re: Drawing a 2D triangle with EGL and GLESv1

I've only had a quick look at this, but your poly is wound clockwise. The default is counter clock wise.

I've not compiled this, but

{0, 0, 0,100, 100, 0}

for your verticies may fix it.

Jim
by dattrax
Mon Aug 27, 2012 8:55 am
Forum: OpenGLES
Topic: Odd problem with alpha in the frame buffer
Replies: 19
Views: 13022

Re: Odd problem with alpha in the frame buffer

Whilst there may be many ways to skin a cat, using blending is not a cost effective way to achieve the correct result.

its going to a instructions to your fragment program.

this is why setting the surface up correctly in dispmanx is a better way to do it.

Cheers
Jim
by dattrax
Fri Aug 24, 2012 10:44 am
Forum: OpenGLES
Topic: OpenGL ES as slow as SDL?
Replies: 39
Views: 11351

Re: OpenGL ES as slow as SDL?

Oops, forgot the shift. Thanks Dom
by dattrax
Fri Aug 24, 2012 10:43 am
Forum: OpenGLES
Topic: OpenGL ES as slow as SDL?
Replies: 39
Views: 11351

Re: OpenGL ES as slow as SDL?

You can scale in hardware, so this will save you some cycles.

There is a src and dst rect parameter to vc_dispmanx_element_add

Set the src to 0,0,256,239 and leave dst as is.

Obviously remove your cpu scale.

Jim
by dattrax
Thu Aug 23, 2012 8:19 pm
Forum: OpenGLES
Topic: OpenGL ES as slow as SDL?
Replies: 39
Views: 11351

Re: OpenGL ES as slow as SDL?

The good news: with dispmanx I get 3 times the FPS than using glTex* in my test application. The bad news: it makes absolutely no difference in Snes9x. I reckon the CPU emulation is taking most of the resources, to the point that rendering optimization has no impact on the overall performances at a...
by dattrax
Thu Aug 23, 2012 8:12 pm
Forum: OpenGLES
Topic: OpenGL ES as slow as SDL?
Replies: 39
Views: 11351

Re: OpenGL ES as slow as SDL?

the majority of the modern devices also have support for linear texture buffers for 'low latency' client uploads. This is true, and is the case for the v3d, however there are a number of additional factors which come into play which you may not have considered. We did some testing on raster texturi...
by dattrax
Wed Aug 22, 2012 4:19 pm
Forum: OpenGLES
Topic: OpenGL ES as slow as SDL?
Replies: 39
Views: 11351

Re: OpenGL ES as slow as SDL?

Two problems with what you are trying to do. 1) the v3d block in the vc4 uses physical memory. You cannot expect to malloc a buffer and just give it to hardware. 2) the v3d block uses a tiled memory format to give consistent results round a rotational axis. Even if you managed to create a vc image a...
by dattrax
Sun Aug 19, 2012 3:27 pm
Forum: OpenGLES
Topic: OpenGL ES as slow as SDL?
Replies: 39
Views: 11351

Re: OpenGL ES as slow as SDL?

sorry I'm not used to this keyboard

should have typed 'dispmanx'. do a search, but here's a thread on it.

http://www.raspberrypi.org/phpBB3/viewt ... =33&t=7672
by dattrax
Sun Aug 19, 2012 2:17 pm
Forum: OpenGLES
Topic: OpenGL ES as slow as SDL?
Replies: 39
Views: 11351

Re: OpenGL ES as slow as SDL?

have you set your texture filtering? In OpenGL the default is mipmapping, so the texture will be incomplete.

If you want raster graphics mapped onto a plane, the best way is just use dispmax rather than OpenGL. Just using it for composition is not a very good use of bandwidth & memory.

Jim
by dattrax
Sun Aug 19, 2012 2:01 pm
Forum: OpenGLES
Topic: Writing graphics shaders design questions
Replies: 3
Views: 1826

Re: Writing graphics shaders design questions

some advise.... do not write uber shaders on the pi.

The compiler uses predication to flatten conditionals and you end up executing everything. There are no issues with changing shaders per draw call, so you are better off stitching multiple variants at startup and drawing with the correct one.
by dattrax
Thu Jul 05, 2012 4:08 pm
Forum: OpenGLES
Topic: Announcement: pishadertoy
Replies: 24
Views: 15189

Re: Announcement: pishadertoy

I had a quick look at Apple, and it looks like the shader backend fails in the draw call. Check the return code after the draw and it should be 'out of memory'. There is probably little you can do to fix this, as the shader is very long. Even using a noise texture would probably not be sufficient. Jim
by dattrax
Sun Jul 01, 2012 10:18 pm
Forum: OpenGLES
Topic: Odd problem with alpha in the frame buffer
Replies: 19
Views: 13022

Re: Odd problem with alpha in the frame buffer

Since you have just or'd 0 with 1, I suspect you aren't getting what you thought. try VC_DISPMANX_ALPHA_T alpha = { DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS,0,0 }; as in the previous post (from blobchaser). Does this fix your alpha issue? > Is there any overhead for doing this? Quite the oposite, durin...
by dattrax
Mon Jun 25, 2012 10:46 pm
Forum: OpenGLES
Topic: Shared memory tricks?
Replies: 5
Views: 4081

Re: Shared memory tricks?

I did some digging in the kernel tree (arch/arm/mach-bcm2708/vc_mem.c) Maps the vc-mem into user space and goes searching for the word "Broadcom" as I figured it would be in the firmware somewhere. The next thing to do would be load a texture and see if you can find it. #include <sys/types.h> #inclu...
by dattrax
Sun Jun 24, 2012 11:29 pm
Forum: OpenGLES
Topic: GL extensions
Replies: 4
Views: 2402

Re: GL extensions

The extension headers are generic.

To find the supported extensions, you need to call glGetString() with GL_EXTENSIONS. You can then do a eglGetProcAddress().

VAO's are not supported.

Jim
by dattrax
Sun Jun 24, 2012 11:24 pm
Forum: OpenGLES
Topic: Odd problem with alpha in the frame buffer
Replies: 19
Views: 13022

Re: Odd problem with alpha in the frame buffer

Hi, I didn't have my pi board connected to a tv at the time, so couldnt test what I sent. Glad you got it working. If you set the blending at the composition it shouldn't have any detremental effects. Ideally you need to force the optimization path in the HW which bypasses the DRAM fetch of the unde...
by dattrax
Wed Jun 20, 2012 4:33 pm
Forum: OpenGLES
Topic: eglGetConfigAttrib returns zero.
Replies: 2
Views: 1556

Re: eglGetConfigAttrib returns zero.

code is wrong. you need to eglGetConfigAttrib(m_display,m_config,EGL_BUFFER_SIZE,&bufSize); eglGetConfigAttrib(m_display,m_config,EGL_RED_SIZE,&r); eglGetConfigAttrib(m_display,m_config,EGL_GREEN_SIZE,&g); eglGetConfigAttrib(m_display,m_config,EGL_BLUE_SIZE,&b); eglGetConfigAttrib(m_display,m_config...

Go to advanced search