GithubHelp home page GithubHelp logo

jkemppainen / cg-compound-eye Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 58 KB

DPP producing 3D model

Python 100.00%
computer-graphics blender luxcorerender parametric-modelling drosophila compound-eye stereo-vision neuroscience deep-pseudopupil rhabdomere

cg-compound-eye's Introduction

CG compound eye

GG-compound-eye is a parametric computer graphics (CG) model of the Drosophila compound eyes, capable of producing the deep pseudopupil (DPP).

It uses Blender's Python-scripting capabilities to procedurally build the model, and LuxCoreRender to simulate/render.

Prerequisites

To produce the eye 3D model

  • Blender 2.80, or newer (tested with 2.93)
  • Working Python 3 installation with Scipy >=1.6.0

Additionally, to render the deep pseudopupil

  • Luxcorerender >= 2.3 (tested with 2.3)

How to use

  1. Ensure the files here and your Blender File (.blend) are in the same directory
  2. In Blender's Text Editor (Scripting), open model_init.py
  3. Press Run Script button

This leads to the 3D model initialization taking some minutes. The model is quite small so you have to zoom in (it fits inside the default cube).

Process and possible error messages can be monitored from the system console (On Windows, Window -> Toggle System Console; On other platforms, launch Blender from a shell)

To render DPP images

  • configure materials (not done by the script yet)
  • change the rendering engine to LuxCore
  • enable camera's Depth of Field

Modification

Distributed as a script, the CG-eye can be easily modified. For details, see the documentation in model_init.py.

Performance

The model building blocks (lenses, rhabdomeres, ...) are created in the beginning (see the hidden collection primitives), and in each ommatidia, the corresponding objects merely reference this data. These linked duplicates keep the memory usage relatively low (~220 MiB).

However, since each ommatidia has 5 parts, already with 700 ommatidia there are 3500 objects in the scene. This amount of objects already slows Blender in some operations. For example, deleting the model can hang up for some time.

I have optimized the model creation using the Blender's low-level API and linking the objects to the scene as late as possible (see LOWLEVEL_OPS, turned on by default). This strategy allows creating larger models up to some thousand ommatidia relatively fast.

cg-compound-eye's People

Contributors

jkemppainen avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.