From BlenderWiki

Jump to: navigation, search

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

  • drawarmature.c
    • done
        (fclem)
  • drawnode.c
    • done
        node_composit_backdrop_viewer (lukas_t)
    • done
        node_composit_backdrop_boxmask (lukas_t)
    • done
        node_composit_backdrop_ellipsemask (lukas_t)
    • done
        ED_node_draw_snap (LucaRood)
  • drawobject.c
    • in progress Inprogress25.jpg 25%
        draw_em_fancy (merwin)
    • done
        draw_mesh_object_outline (merwin)
    • done
        draw object centers (merwin)
    • done
        drawaxes & empties (merwin)
    • done
        draw image empties (merwin)
    • done
        draw cameras (merwin)
    • done
        draw lamps (merwin)
  • drawsimdebug.c
    • done
        quick and dirty debug primitives (lukas_t)
  • drawvolume.c
    • in progress Inprogress50.jpg 50%
        (lukas_t)
  • editarmature_sketch.c
    • pending review on D2501
  • file_draw.c
    • in progress Inprogress100.jpg 90%
        (plasmasolutions)
  • graph_draw.c
    • done
        draw fcurve control points & handles (merwin)
  • image_draw.c
    • in progress Inprogress25.jpg 10%
        (merwin)
  • interface_draw.c
    • done
        UI_draw_roundbox_gl_mode (kgeogeo)
    • done
        (fclem)
  • interface_icons.c
    • in progress Inprogress50.jpg 50%
        (Juicyfruit, merwin)
  • interface_panel.c
    • done
        (fclem)
  • interface_regions.c
    • done
        ((fclem) nothing to do?)
  • interface_style.c
    • done
        ((fclem) nothing to do?)
  • interface_widgets.c
    • done
        (fclem)
  • mask_draw.c
    • in progress Inprogress25.jpg 20%
        (ryry)
  • node_draw.c
    • done
        node_socket_circle_draw (kgeogeo)
    • in progress Inprogress25.jpg 20%
        node_draw_preview_background (merwin)
  • outliner_draw.c
    • in progress Inprogress100.jpg 81%
        (cyrax)
  • paint_cursor.c
  • paint_stroke.c
    • done
        (fclem)
  • render_internal.c
  • resources.c
  • screen_draw.c
    • done
        (fclem)
  • sequencer_draw.c
    • in progress Inprogress100.jpg 98%
        (LucaRood)
  • text_draw.c
    • in progress Inprogress0.jpg 0%
        (mizerb)
  • textview.c
    • in progress Inprogress25.jpg 20%
        (witt)
  • transform_manipulator.c
    • done
        (fclem) (Julian) (Will be replaced by new manipulators)
  • uvedit_smart_stitch.c
    • done
        (fclem)
  • view3d_draw_legacy.c
    • in progress Inprogress100.jpg 90%
        (dfelinto) (miss circ, view3d_main_region_clear, bl_debug_draw)
  • wm_dragdrop.c
  • wm_gesture.c

Help Wanted - Game Engine

The UPBGE team plans to merge their work into Blender2.8 so we should leave these files alone.

//source/gameengine

  • 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
  • gpu_compositing.c
  • gpu_draw.c
  • gpu_framebuffer.c
  • 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)
  • drawgpencil.c (the remaining code is commented out)
  • pbvh.c (only has a glColor3f(), which is in an ifdef'ed out test block (#ifdef 0) (ianwill)
  • reeb.c (only has gl[A-Z] calls in an #ifdef'ed out function called REEB_draw() (ianwill)
  • transform_snap.c (the remaining code is commented out)
  • 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

  • done
      action_draw.c (darwin, merwin)
  • done
      anim_channels_defines.c (define-private-public)
  • done
      anim_draw.c (punya)
  • done
      anim_markers.c (dfelinto)
  • done
      area.c (punya, dfelinto)
  • done
      blf_glyph.c (merwin)
  • done
      console_draw.c (juicyfruit)
  • done
      clip_dopesheet_draw.c (TCMBoby)
  • done
      clip_draw.c (LucaRood)
  • done
      clip_graph_draw.c (LucaRood)
  • done
      clip_utils.c (darwin)
  • done
      drawanimviz.c (LucaRood)
  • done
      drawgpencil.c (merwin)
  • done
      ed_util.c (dfelinto)
  • done
      editcurve_paint.c (dfelinto)
  • done
      editmesh_knife.c (LucaRood)
  • done
      editmesh_loopcut.c (LucaRood)
  • done
      gpencil_brush.c (merwin)
  • done
      gpencil_paint.c (merwin)
  • done
      keyframes_draw.c (darwin, merwin)
  • done
      nla_draw.c (plasmasolutions, merwin)
  • done
      paint_image.c (ianwill)
  • done
      pbvh.c (ianwill)
  • done
      reeb.c (ianwill)
  • done
      screendump.c (ianwill)
  • done
      sculpt_uv.c (dfelinto)
  • done
      space_graph.c (LucaRood)
  • done
      transform.c (witt, darwin, merwin)
  • done
      transform_constraints.c (LucaRood)
  • done
      transform_generics.c (LucaRood)
  • done
      transform_snap.c (LucaRood)
  • done
      space_time.c (dfelinto)
  • done
      uvedit_draw.c (LucaRood)
  • done
      view2d.c (define-private-public)
  • done
      view3d_ruler.c (LucaRood)
  • done
      wm_operators.c (ianwill)
  • done
      wm_playanim.c (ianwill)

Examples

  • done
      view3d_walk.c (Dfelinto)
  • done
      view3d_fly.c (Dfelinto)
  • in progress Inprogress75.jpg 75%
      example.c
    • Operators only
  • in progress Inprogress50.jpg 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 "\.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 glBegin\( \
    -e glColor \
    -e glDisableClientState \
    -e glEnableClientState \
    -e glEnd\( \
    -e glNormal \
    -e glRect \
    -e glTexCoord \
    -e glVertex[^A] \
    -e glVertexPointer \
    -e sdrawline \
    -e sdrawbox \
    -e UI_ThemeColor \
. 2>/dev/null | sed s'/.*\//* /g' | sort

Then organized by hand.