Git Product home page Git Product logo

kosua20 / herebedragons Goto Github PK

View Code? Open in Web Editor NEW
1.7K 45.0 78.0 162.38 MB

A basic 3D scene implemented with various engines, frameworks or APIs.

Home Page: http://simonrodriguez.fr/dragon

License: MIT License

Makefile 0.05% C 84.78% C++ 13.75% JavaScript 0.11% HTML 0.01% Swift 0.09% C# 0.16% Metal 0.01% Objective-C 0.49% Lua 0.10% CMake 0.15% Batchfile 0.01% Shell 0.01% GLSL 0.23% WGSL 0.01% GDScript 0.01% HLSL 0.03% VCL 0.02%
computer-graphics graphics-programming rendering opengl scenekit cycles blender nds unity webgl

herebedragons's Introduction

Here be dragons

Hic sunt dracones.

This repository contains multiple implementations of the same 3D scene, using different APIs and frameworks on various platforms. The goal is to provide a comparison between multiple rendering methods. This is inherently biased due to the variety of algorithms used and available CPU/GPU configurations, but can hopefully still provide interesting insights on 3D rendering. You can check a video of most versions runnning here (Youtube)

The following versions are currently available:

The following versions are (tentatively) planned:

  • OpenGL ES
  • other console hardwares
  • other engines
  • another raytracing approach

In the directory of each version, you can find the source code, the corresponding resources (as each method has its own format/quality constraints), along with a readme describing the method and a few examples.

Resources

The scene is composed of four main elements:

  • a plane representing the ground, with a pavement texture.
  • a dragon (the Stanford dragon).
  • a monkey head ('Suzanne') rotating around its vertical axis.
  • a skybox surrounding the scene, textured with a cloudy sky.

Additionally, the sun is simulated by using a directional light, and the camera should be able to rotate around the scene. Note that some versions might provide additional effects, such as soft shadow maps, parallax mapping or screen space ambient occlusion. The initial 3D models and textures are contained in the opengl/resources directory.

Other implementations

Here you can find implementations using some of the above APIs combined with other programming languages, submitted by awesome people!

herebedragons's People

Contributors

ad-m avatar chadoliver avatar kenanwarren avatar kosua20 avatar themriron2 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  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  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

herebedragons's Issues

Glide API test

If you can get your hands on a 3DFX Voodoo card it would be awesome to test it on Glide!

Info: the PS2 demo runs on real hardware

I've tried launching the PS2 version of this demo using uLaunchELF on my PAL PS2 slim, and it seems to work without any issues.

It might be worth adding that the PS2 demo was tested on real hardware as well. I can provide photos of it running as well if there's interest.

PS2 Optimisations

Some future ideas for more optimal circumstances on PS2:

  • The PS2 GPU memory is fast enough to flush and refill textures multiple times per frame, according to the developers of Metal Gear Solid 2 - who had up to 10MB of textures on-screen at times inside the 4MB VRAM (total, not including memory used for buffers). It may be possible to use similar techniques to achieve better results in this demo.
  • I feel better looking textures could be used with the above method and storing these in the main 32MB RAM and sending them to the GPU as needed - the PS2 has a 3.6GB/s memory bus so the potential is undoubtedly there.
  • Using recent gsKit tools available on github may also give the code some cleaner syntax and possibly expand the available libraries?
  • Different video modes; I would say that a 640x448i mode and a 640x480p mode would be optimal, however 640x540 at 1080i would also be very interesting - a few games used this for a 1080i mode, and this could look great on HDTVs possibly with antialiasing.

Keep this project up, though. It's nice to see demos like this arise on the PS2. I recommend you check out the gsKit "hi-res" sample code for an idea of what you might be able to do - this seems like a relatively simple scene, and one programmer was able to get a rotating 3D teapot running at native 1920x1080, a 1920x1080 background texture and all with antialiasing at 60FPS. Would be cool to see some improvements here from code like that.

WebGL Code cleanup?

There's a few, um, less than best practices in the WebGL code. I didn't look at the others

2 examples

  • looking up uniform and attribute locations every frame at render time instead of once at init time

  • assigning properties to WebGLObjects that could be null

There's also questionable issues like forcing 800x600. That might make sense on desktop PCs where you'd be hard pressed to find a display that's only 800x600 but it makes far less sense on a browser that might be viewed in a phone where the phone is trying to emulate 320x568 resolution.

Another is using devicePixelRatio. Does that happen on your c++ version? In other words if you open an 800x600 window are you getting 800x600 pixels or 800x600 * devicePixelRatio

Other random stuff

Setting the size of the canvas directly is kind of an anti-pattern. You should let CSS choose the size on the web.

Vertex Buffer Objects are available pretty much universally on WebGL

http://webglstats.com/webgl/extension/OES_vertex_array_object?platforms=0000dfffcfbfabfd01

In fact it's only IE and Edge that, not the actual hardware so if you want to use them you can either just use them and tell IE and Edge users they're S.O.L. or you can use polyfill that will just fill it in on IE and EDGE.

Would you be interested in a PR that deals with those issues?

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.