Dev:2.8/Source/OpenGL/Immediate Mode Replacement Tasks
目次
Immediate Mode Replacement Tasks
What and how to do it
See Immediate Mode Replacement call for help.
What exactly needs to be recoded? Any calls to glBegin, glEnd, glVertex, glColor, glNormal, glTexCoord, glRect.
What does not need to be recoded?
State-setting functions such as glEnable, glDisable, glPointSize, glBlendFunc, glDepthFunc, glDepthMask, glColorMask …
glLineWidth is also legacy, but let’s not worry about that just yet!
Utility functions such as UI_ThemeColor and fdrawline call the old GL functions, so find ways to draw without these. Use the new immUniformThemeColor instead, and draw lines with immVertex immVertex.
Help Wanted - Blender
//source/blender
- drawobject.c
- in progress 25%draw_em_fancy (merwin)
- donedraw_mesh_object_outline (merwin)
- donedraw object centers (merwin)
- donedrawaxes & empties (merwin)
- donedraw image empties (merwin)
- donedraw cameras (merwin)
- donedraw lamps (merwin)
- in progress 90%(fclem) (miss some mesh drawing code, waiting for DM to be ported)
- drawvolume.c
- in progress 50%(lukas_t)
- image_draw.c
- in progress 10%(merwin)
- in progress 10%paint_cursor.c (merwin)
- resources.c
- view3d_draw_legacy.c
- in progress 90%(dfelinto) (miss circ, view3d_main_region_clear, bl_debug_draw)
Help Wanted - Game Engine
The UPBGE team plans to merge their work into Blender2.8 so we should leave these files alone.
//source/gameengine
- ImageRender.cpp
- KX_Dome.cpp
- RAS_2DFilterManager.cpp
- RAS_OpenGLRasterizer.cpp
- RAS_StorageVA.cpp
- RAS_StorageVBO.cpp
Help Wanted - Intern
//intern
- device.cpp
- device_cuda.cpp
- opensubdiv_capi.cc
- solver_control.cpp
- solver_util.cpp
- util_view.cpp
To be tackled separately
- glutil.c
- drawmesh.c
- DerivedMesh.c
- cdderivedmesh.c
- editderivedmesh.c
- subsurf_ccg.c
- gpu_buffers.c
- donegpu_compositing.c (fclem)
- gpu_draw.c
- donegpu_framebuffer.c (fclem)
- gpu_basic_shader.c
- GPU_basic_shader.h
- gl-deprecated.h
Low priority / Obsolete
- GHOST_C-Test.c
- GHOST_Test.cpp
- MultiTest.c
Notes
(write down any false positive that may come up from the grep query)
- area.c - it needs to be revisited once the MatrixAPI supports 2D (see 31a21135)
- wm_playanim.c (requires decision about bg mode access to gpu) (ianwill)
- uvedit_draw.c (still has one UI_ThemeColor call because of unconverted DM callback) (LucaRood)
Done
- doneaction_draw.c (darwin, merwin)
- doneanim_channels_defines.c (define-private-public)
- doneanim_draw.c (punya)
- doneanim_markers.c (dfelinto)
- donearea.c (punya, dfelinto)
- doneblf_glyph.c (merwin)
- doneconsole_draw.c (juicyfruit)
- doneclip_dopesheet_draw.c (TCMBoby)
- doneclip_draw.c (LucaRood)
- doneclip_graph_draw.c (LucaRood)
- doneclip_utils.c (darwin)
- donedrawanimviz.c (LucaRood)
- donedrawarmature.c (fclem)
- donedrawgpencil.c (merwin)
- donedrawnode.c (lukas_t, LucaRood)
- donedrawsimdebug.c (lukas_t)
- doneed_util.c (dfelinto)
- doneeditarmature_sketch.c (khanh_ha)
- doneeditcurve_paint.c (dfelinto)
- doneeditmesh_knife.c (LucaRood)
- doneeditmesh_loopcut.c (LucaRood)
- donefile_draw.c (plasmasolutions, LucaRood)
- donegpencil_brush.c (merwin)
- donegpencil_paint.c (merwin)
- donegraph_draw.c (merwin, LucaRood)
- doneinterface_draw.c (kgeogeo, fclem)
- doneinterface_icons.c (Juicyfruit, merwin)
- doneinterface_panel.c (fclem)
- doneinterface_widgets.c (fclem)
- donekeyframes_draw.c (darwin, merwin)
- donemask_draw.c (ryry, merwin)
- donenla_draw.c (plasmasolutions, merwin)
- donenode_draw.c (kgeogeo, merwin, LucaRood)
- doneoutliner_draw.c (cyrax, LucaRood)
- donepaint_image.c (ianwill)
- donepaint_stroke.c (fclem)
- donepbvh.c (ianwill)
- donereeb.c (ianwill)
- donerender_internal.c (dfelinto, fclem)
- donescreendump.c (ianwill)
- donesculpt_uv.c (dfelinto)
- donespace_graph.c (LucaRood)
- donetext_draw.c (dfelinto)
- donetextview.c (witt)
- donetransform.c (witt, darwin, merwin)
- donetransform_constraints.c (LucaRood)
- donetransform_generics.c (LucaRood)
- donetransform_manipulator.c (fclem)
- donetransform_snap.c (LucaRood)
- donescreen_draw.c (fclem)
- donesequencer_draw.c (LucaRood)
- donespace_time.c (dfelinto)
- doneuvedit_draw.c (LucaRood)
- doneuvedit_smart_stitch.c (fclem)
- doneview2d.c (define-private-public)
- doneview3d_ruler.c (LucaRood)
- donewm_dragdrop.c (ianwill)
- donewm_gesture.c (ianwill)
- donewm_operators.c (ianwill)
- donewm_playanim.c (ianwill)
Examples
- doneview3d_walk.c (Dfelinto)
- doneview3d_fly.c (Dfelinto)
- in progress 75%example.c
- Operators only
- in progress 50%yet_another_example.h (Dfelinto)
- glBegin
Is a file done?
To check if a file is done use the following script:
https://github.com/dfelinto/immediate-mode-query/blob/master/query
It basically uses the query below. Both will be kept updated if we decide to expand the query.
Note
Complete list compiled with the following command:
find . -name "*.[c|cpp|h|m|mm]*" -print | grep -v "bgl\.c" | grep -v "\.pyc" | grep -v "\.git" | grep -v "\.svn" | grep -v ".swp" | grep -v "~" | sort | xargs grep -l -n --color=never -H \
-e fdrawbox \
-e fdrawbox_filled \
-e fdrawcheckerboard \
-e fdrawline \
-e sdrawline \
-e sdrawbox \
-e UI_ThemeColor \
-e glAlphaFunc \
-e glBegin\( \
-e glCallList \
-e glCallLists \
-e glColor[^M] \
-e glClipPlane \
-e glDeleteLists \
-e glDisableClientState \
-e glDrawPixels \
-e glEnableClientState \
-e glEnd\( \
-e glEndList \
-e glFeedbackBuffer \
-e glGenLists \
-e glInitNames \
-e glIsList \
-e glLight[if] \
-e glLineStipple \
-e glListBase \
-e glLoadName \
-e glMaterial[if] \
-e glNewList \
-e glNormal \
-e glPassThrough \
-e glPixelZoom \
-e glPolygonStipple \
-e glPopAttrib \
-e glPopClientAttrib \
-e glPopName \
-e glPushAttrib \
-e glPushClientAttrib \
-e glPushName \
-e glRasterPos \
-e glRect[if] \
-e glRenderMode \
-e glSelectBuffer \
-e glShadeModel \
-e glTexCoord \
-e glTexGen \
-e glVertex[^A] \
-e glVertexPointer \
-e glWindowPos \
-e GL_ACCUM_.*_BITS \
-e GL_ALPHA_TEST \
-e GL_COLOR_MATERIAL \
-e GL_DEPTH_TEXTURE_MODE \
-e GL_LIGHTING \
-e GL_LINE_STIPPLE \
-e GL_LUMINANCE \
-e GL_POINT_SPRITE \
-e GL_TEXTURE_ENV_ \
-e GL_TEXTURE_GEN_ \
. 2>/dev/null | sed s'/.*\//* /g' | sort
Then organized by hand.