Changes between Version 231 and Version 232 of AndroidPort


Ignore:
Timestamp:
Feb 13, 2012, 7:14:04 AM (12 years ago)
Author:
Anders Feder
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AndroidPort

    v231 v232  
    105105
    106106I think the best approach is to extend graphics/!ShaderProgram.cpp to support GLSL shaders (it was designed with that in mind, but I don't know if it'll actually work without some interface changes); then move all the renderer's existing fixed-function texture-environment setup code into ShaderProgramFFP.cpp and implement GLSL-based equivalents, so that most of the rest of the renderer code doesn't have to care whether it's using FFP or GLSL (it just uses the CShaderProgram interface). Also, change all immediate-mode drawing (glVertex3f etc) to vertex arrays. I think that should deal with the most serious problems, and the code would all be shared between GLES and desktop GL modes (no need for forking or #ifdefs etc) and can be tested with desktop GL. Then there's probably just lots of little issues remaining, which can be addressed as they occur.
     107
     108The basic strategy is that any fixed-function multitexture setup code (glTexEnvi etc) should be moved to ShaderProgramFFP.cpp, and the rendering code should load it via g_Renderer.!GetShaderManager().!LoadEffect(...), so that we can easily add a GLSL-based implementation of the shader later. Then the rendering code should replace calls to glVertexPointer(...) etc with shader->!VertexPointer(...) (which translates the fixed-function arrays into generic vertex attributes for GLES-compatible GLSL). Then replace all glBegin/glVertex3f/etc drawing with vertex arrays and glDrawArrays. Then replace the GL global matrix stuff with client-side computation of the model-view-projection matrix, and pass it to the shader with shader->Uniform("transform", m). I think the shader API provides everything that's needed for this now, so the remaining work is mostly just mechanical translation.
    107109
    108110=== Other dependencies ===