Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (794)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (864)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Modern3D: low-level shader-centric 3D graphics library  (Read 6321 times)
0 Members and 1 Guest are viewing this topic.
Offline jezek2
« Posted 2009-10-23 04:59:47 »

Modern3D is low-level 3D graphics library (similar to OpenGL or Direct3D) written in Java. It's entirely shader centric, this means you set the shader, its inputs, how it interacts with frame buffer, setup geometry and draw. No fixed functionality is present except things that are not covered by shaders (like blending). There are no matrices stacks, it's entirely on you what inputs you feed into your shaders.


  • easy to use low-level object oriented API, can be compared to OpenGL/Direct3D level
  • shaders are written in Cg language and precompiled (no Cg runtime required for your application)
  • currently supports Shader Model 2.0 and 2.0a/2.0b
  • uses OpenGL 1.4 with extensions for actual HW access (through LWJGL)
  • there is only one way to access HW features (like using VBOs exclusively)
  • geometry utilities for drawing primitives immediatelly (own implementation that uses VBOs) or for storing for later usage
  • provides Java2D API implementation that allows advanced 2D drawing (including text and non-trivial vector shapes)
  • utility classes for matrix stacks handling
  • support for conversion to and from half data type (16bit float)
  • batched geometry builder class for easy to use generation of optimized static geometry
  • open source, distributed under BSD license


  • currently only SM 2.0 and 2.0a/2.0b are supported, more profiles will be available in future
  • fixed function pipeline support (implemented as special "shader") is also considered for some future version
  • GLSL is currently unsupported, but will be added in some future version (using both runtime compilation and pre-compilation using Cg compiler)
  • it's currently using only OpenGL through LWJGL, but due to modular implementations it could use JOGL or even Direct3D when some binding for it will emerge
  • drawing of arbitrary shapes has antialiasing disabled currently, there is proof of concept implementation that can be enabled in sources
  • not all blend operators using Java2D API are correctly working
  • some less used features are currently missing (such as 3D textures)

You can download it on Modern3D homepage.
Offline gouessej
« Reply #1 - Posted 2009-10-23 21:56:32 »

It seems interesting, I'm going to look at your library now. Thanks.

Edit.: I don't know whether it would be difficult to use it with JOGL 2 and GLSL.

Julien Gouesse | Personal blog | Website | Jogamp
Offline Nate

« JGO Bitwise Duke »

Medals: 167
Projects: 4
Exp: 14 years

Esoteric Software

« Reply #2 - Posted 2009-10-24 06:45:32 »

Sounds cool! It is definitely on my list to check it out.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline CommanderKeith
« Reply #3 - Posted 2009-10-24 13:53:56 »

Sounds very interesting, the Java-2D alike API is a good idea. It'd be cool to see some demos of what it can do.

Offline zeyous

Junior Devvie

Projects: 1

« Reply #4 - Posted 2009-10-25 20:30:23 »

Wow dude that is awesome. The only way to have good performance these days with modern GPU is to use Shaders. We definitively need library like this.

What performance boost did you measure using Modern3d for Java2D drawing ?
Do you plan to support Geometric shaders ?

I'll rewrite sooner or later my 3d engine using shaders, I draw graphs, nothing complicated expect thousands of thousands lines and spheres, your library could be a great help !

Thanks again, great job !

Offline jezek2
« Reply #5 - Posted 2009-10-25 21:06:34 »

Wow dude that is awesome. The only way to have good performance these days with modern GPU is to use Shaders. We definitively need library like this.

While shaders can be used to some performance boost from fixed function pipeline (which is emulated using shaders on "modern" shader capable cards), it's mainly about different way of rendering and having much more freedom.

What performance boost did you measure using Modern3d for Java2D drawing ?

The arbitrary shape rendering in Java2D is pretty much "incompatible" with how 3D accelerators works, the geometry needs to be tesselated into triangles, or use bruteforce approach using stencil buffer. Modern3D uses the latter as polygon triangulation is very hard to be working for every case and also the time spent on triangulation can be slower than using bruteforce approach. This means there is probably not much good performance improvement against optimized software rendering, but the advantage is that for rendering such shapes you don't have to stall the GPU pipeline or even upload tons of data each frame from software renderer.

Do you plan to support Geometric shaders ?

Yes, at some point in future. But as I don't have HW to test on (have GF6600GT on AGP 4x) and it's highly unlikely I will upgrade in year or two, the support would be needed to be done by someone else.
Offline jezek2
« Reply #6 - Posted 2010-03-25 17:15:01 »

New version available on Modern3D homepage.

Changes in release 20100325:
- Fixed issue with broken characters
- Added clamping when drawing images
- Fixed compilation under Java 5
- Fixed setting of depth mask when clearing depth buffer
- Added TextureRect and Texture3D
- Fixed compiling of shaders when constant registers are explicit
- Fixed issue when not all vertex arrays are used in shader
- Added support for LUMINANCE8 and ALPHA8 textures for BufferedImages
- Fixed drawing of transformed fonts
- Added common API for external image flushing
- Added auto generation of NameID constants
- Added SHDC define so shaders can detect if they're processed using shdc
- Added support for 64bit on Windows for shdc
- Other bug fixes
Pages: [1]
  ignore  |  Print  

hadezbladez (3228 views)
2018-11-16 13:46:03

hadezbladez (1157 views)
2018-11-16 13:41:33

hadezbladez (3195 views)
2018-11-16 13:35:35

hadezbladez (632 views)
2018-11-16 13:32:03

EgonOlsen (3922 views)
2018-06-10 19:43:48

EgonOlsen (4406 views)
2018-06-10 19:43:44

EgonOlsen (2624 views)
2018-06-10 19:43:20

DesertCoockie (3459 views)
2018-05-13 18:23:11

nelsongames (3575 views)
2018-04-24 18:15:36

nelsongames (4622 views)
2018-04-24 18:14:32
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!