-2

I had done a program that worked. There was in a rendering in framebuffer attached to a texture in float32. For this fact, I activated an extension

var ext = gl.getExtension ("OES_texture_float");  //weglbl
var ext = gl.getExtension ("EXT_color_buffer_float"); webgl2

the blend was activated:

gl.enable (gl.BLEND);
gl.blendFunc (gl.ONE, gl.ONE);

which made it possible to add components (which represented particle speeds)

I am doing the same thing but with opengl es 3.0 :

The RTT works well, however it is at the level of the blend that I have an error :

GLES32.glEnable(GLES32.GL_BLEND);
GLES32.glBlendFunc(GLES32.GL_ONE, GLES32.GL_ONE);
GLES32.glDrawArrays (GLES32.GL_POINTS, 0, COUNT);
int error = GLES32.glGetError (); // 1282 invalid

(error==0 if blending is desactived)

1282 is for INVALID_OPERATION

the specification tell me:

"An INVALID_OPERATION error is generated by any command that transfers vertices to the GL if blending is enabled (see below) and any draw buffer has 32-bit floating-point format components."

While searching I came across this sub extension: https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_float_blend.txt

but how to activate it?

What is the equivalent instruction in opengl es for gl.getExtension

oh, one last point, the application runs on a smartphone, while the program in webgl runs on a desktop

thank you very much for your lumières

oceanGermanique
  • 336
  • 3
  • 16
  • 2
    *but how to activate it?* you can't ... you can only check if it's implemented or not on given device – Selvin Dec 20 '17 at 12:39
  • 1
    More generally note that fp32 render targets are *really* expensive on mobile (in terms of performance and energy efficiency). Use fp16 if you really need float, or RGB10_A2 RG11_B10 if you can. – solidpixel Dec 20 '17 at 13:19
  • ok...."GL_OES_texture_float" is not in my device.... – oceanGermanique Dec 20 '17 at 13:24

1 Answers1

0

Thanks to @Selvin , i succeeded using a texture RGBA encoded in GL_HALF_FLOAT. So, the blend mode works this time!

oceanGermanique
  • 336
  • 3
  • 16