Режим наложения Photoshop к OpenGL ES без программ построения теней

У меня проблема. Когда вы создаете новый файл, используя File file = new File (path), не добавляйте file:// перед этим путем.

Это правильно -

String url = "/storage/emulated/0/Android/data/com.verna.poc/files/Download/mypdf.pdf";
File file= new File(url);

Это неправильно -

String url = "file:///storage/emulated/0/Android/data/com.verna.poc/files/Download/mypdf.pdf";
File file= new File(url);
16
задан bobobobo 4 April 2013 в 23:16
поделиться

3 ответа

Most photoshop blend-modes are based upon the Porter-Duff blendmodes.

These requires that all your images (textures, renderbuffer) are in premultiplied color-space. This is usually done by multiplying all pixel-values with the alpha-value before storing them in a texture. E.g. a full transparent pixel will look like black in non-premultiplied color space. If you're unfamiliar with this color-space spend an hour or two reading about it on the web. It's a neat and good concept and required for photoshop-like compositions.

Anyway - once you have your images in that format you can enable SCREEN using:

glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR)

The full MULTIPLY mode is not possible with the OpenGL|ES pipeline. If you only work with full opaque pixels you can fake it using:

glBlendFunc(GL_ZERO, GL_SRC_COLOR)

The results for transparent pixels either in your texture and your framebuffer will be wrong though.

15
ответ дан 30 November 2019 в 21:20
поделиться

Лучше всего начать с того, чтобы взять копию Красной книги и прочитать главы о материалах и режимах смешивания. Он содержит очень полное и четкое объяснение того, как работают «классические» функции смешивания OpenGL.

1
ответ дан 30 November 2019 в 21:20
поделиться

вы должны попробовать следующее:

glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA)

Мне кажется, это умножение на iPhone / OpenGL ES

10
ответ дан 30 November 2019 в 21:20
поделиться
Другие вопросы по тегам:

Похожие вопросы: