Code Monkey home page Code Monkey logo

gthree's Introduction

Gthree is a port of three.js to GObject and Gtk3.
The code is a partial copy of three.js, and the API
is very similar, although it only supports OpenGL.

For information about three.js, see: http://threejs.org

gthree's People

Contributors

alexlarsson avatar ebassi avatar fanc999-1 avatar jtojnar avatar lw64 avatar ssssam avatar t-chaik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gthree's Issues

Better format for pixbufs

It doesn't make sense to use a non-premultiplied format for textures, and GdkPixbuf isn't exactly great. Move to cairo_surface_t? or custom GBytes?

Make resources fully per-renderer

The current code assumes that each GthreeRenderer has full access to the gl context (it tracks the current state after all). GthreeResources are then realized for a particular renderer with e.g. gthree_resource_set_realized_for().

However, we're currently only storing one copy of the gl resources for the various resources (textures, attributes, render-targets), which is not quite right. If you're using the same resources in multiple renderers we should really allocate once for each renderer.

With the current code we should really assert that we realize for the right renderer, however that will break the current multi-view demo which currently works by chance due to the way Gtk+ makes all gl contexts in the same window share resources...

Spot light shadow seems broken

in examples/shadows the (blue) spotlight doesn't seem to cast any shadows on the "floor". Or rather, there is no blue at all on the floor even when there isn't supposed to be any shadows.

material_set_depth_write(FALSE) issues

When you disable depth writes for some object this seem to break rendering of other objects in the scene. For example, disabling it on the booster in gnome-hexl shows this (see TODO in the ship effects code).

Support per-material clipping planes

This would be nice to have for gnome-hexgl hud texture clipping instead of having to use separate passes. And the code is mostly there anyway.

GthreePoint depth handling

In the points example, some of the flakes combine correctly, but some overwrite the ones behind them even in the area where the map is transparent. Disabling depth tests doesn't seem to fix it, but depth_write does (although that has other issues).

Add helpers

three.js has a bunch of helpers that are useful to generate interesting geomtries for demos and debugging. For example, these would be nice to have:

  • ArrowHelper
  • AxesHelper
  • CameraHelper
  • PlaneHelper
  • GridHelper
  • SkeletonHelper

etc.

Cant build after this commit

Hello Alex.

a38a231 build fine, but next commit 2092385 build fail. :)

Build log:

/usr/bin/ld: gthree/a0bd3e6@@gthree-1@sha/gthreerenderer.c.o: in function `project_planes':
/builddir/build/BUILD/alexlarsson-gthree-2092385/x86_64-redhat-linux-gnu/../gthree/gthreerenderer.c:1214: undefined reference to `graphene_plane_transform'
collect2: error: ld returned 1 exit status

Search paths for Graphene-1.0.gir doesn't include /usr/local

Make error:

Couldn't find include 'Graphene-1.0.gir' (search path: ['gir-1.0', '/usr/share/gir-1.0', '/usr/share/gir-1.0', '/usr/share/gir-1.0'])
/usr/share/gobject-introspection-1.0/Makefile.introspection:153: recipe for target 'Gthree-1.0.gir' failed

I've installed Graphene to /usr/local folder, its .gir file was placed by make install command here:

/usr/local/share/gir-1.0/Graphene-1.0.gir

Issues with shadows for PointLights

I added support for shadow maps to GthreePointLight, and the examples/shadow test. However, the shadow looks wrong to me, needs debugging.

Backport negative scale handling for backface culling

It turns out that three.js has some special code to handle negative scaling in the backface culling code. If the determinant of the transform matrix is negative it auto-flips back and front faces.
If this support is backported, we should also revert d33040a

It's alive !

Just want to +1 on this project. It's a nice surprise coming back from Libre Graphics Meeting, to see this project get some commits :)

Add missing privitives

Three.js has some more primitives that would be nice to have. For example:

  • Cone
  • Circle
  • Dodecahedron
  • Edges
  • Icosahedron
  • Plane
  • etc

Drop mulitmaterial?

three.js dropped multimaterial in favour of material being an array. Should we do the same?

Implement skinning via float textures

On GL implementations that support float textures we can more efficiently compute the skinning. There is code in three.js for this we can backport.

Drop use of GdkRGBA

Should consider using a graphene_vec3_t instead, this way we a) avoid a gratiious dependency on gtk+ int the core APIs (for example for multi-gtk versions), and b) expose the fact that we never read the alpha part of the GdkRGBA anyway.

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.