How to use shaders in OpenGL ES with iPhone SDK

I have this obsession to make character animation in real time based on inverse kinematics and morphing goals.

I did a great job with Animata, an open source animation program (FLTK-based, unfortunately) IK-chain. I even ported their rendering code to various platforms (Java / Processing and iPhone) alt video http://ats.vimeo.com/612/732/61273232_100.jpg of Animata video objects

Nevertheless, I was never sure that their code is especially optimized, and it seems that modeling every frame requires a lot of simulation on the processor, which seems a bit unnecessary to me.

Now I'm starting a project to create an application on the iPad, which relies heavily on real-time character animation and browses through the iOS documentation. I found a code snippet for the "Two Shader Shaders"

// A vertex shader that efficiently implements two bone skinning.

attribute vec4 a_position;
attribute float a_joint1, a_joint2;
attribute float a_weight1, a_weight2;

uniform mat4 u_skinningMatrix[JOINT_COUNT];
uniform mat4 u_modelViewProjectionMatrix;

void main(void)
{
    vec4 p0 = u_skinningMatrix[int(a_joint1)] * a_position;
    vec4 p1 = u_skinningMatrix[int(a_joint2)] * a_position;
    vec4 p = p0 * a_weight1 + p1 * a_weight2;
    gl_Position = u_modelViewProjectionMatrix * p;
}

Does anyone know how I will use such a fragment? It is presented with very little context. I think what I need to do is to make the IK code animation that I want to do, but on the GPU.

+3
source share
1 answer

I have done a lot of research and now I feel that I almost understand what it is.

, , , OpenGL 1.1 OpenGL 2.0. 2.0 , GPU , . v1.1, pushmatrix/popmatrix .

, OpenGL, : Joe Blog: OpenGL

, , . "" -, "" .

, ( , ), ( ), .

, , , , .

iPhone, , , OpenGL ES . OpenGL 1.1, OpenGL 2.0. GL1.1, , iPhone, iPad, iPad. , GL2.0.

+3

Source: https://habr.com/ru/post/1753059/


All Articles