Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (807)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (872)
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  
  spck framework(?)  (Read 2336 times)
0 Members and 1 Guest are viewing this topic.
Offline mudlee
« Posted 2020-02-05 15:19:25 »

Hi Everyone.

In the last couple of weeks I was working on my game idea which I presented somewhere here as well, but I halted it down for various reason.
Instead of this game I started to work on a framework which I call Spck.

This framework will do somewhat similar as libgdx long term, but short term it will just be a simple tool that I will use for my projects. I created this topic to get some feedback if it will be usable for someone else too and I'd like to gather some ideas as well.

Features (in priority order):
  • cross platform (opengl, vulkan, metal, directx) rendering via bgfx (through lwjgl), currently desktop only - done
  • Java 11 modular structure - done
  • Packaging via jlink
  • Tools for shader loading, parsing
  • ECS via Ashley
  • Obj file importing via Assimp
  • Batch rendering
  • A simple input system
  • A very simple UI framework
  • A very simple sound system
  • Tools for tiled map parsing
  • Android support
  • iOS support
  • ?
Offline VaTTeRGeR
« Reply #1 - Posted 2020-02-05 16:20:23 »

This is my honest opinion on your featureset:

  • ECS via Ashley - Disgusting persecutioncomplex use Artemis-odb, it's faster and more mature.
  • Java 11 modular structure - Thumbs up
  • Packaging via jlink - Thumbs up
  • ...
  • THE REST - LibGDX offers this already

If you make the engine very easy to use and also very very fast at what it can do i would consider trying it out, you know something that can be used to bang together prototypes at a gamejam. LibGDX is somewhat slow and bloated in some areas, it could really use some performance optimizations in the 3D section, it isn't nowhere near how good it could potentially perform.

Apart from that i can't see the merit of it compared to LibGDX or other Frameworks. That shouldn't discourage you though, making an engine is a great programming exercise.
Offline mudlee
« Reply #2 - Posted 2020-02-05 16:27:19 »

I ment artemis really, I dont know why I wrote ashley :O
The goal is not beat or replace libgdx in anyway (I'm not that smart), but have something, not an engine but just a framework which can be used easily to start a java based game project which supports crossplatform rendering in native way with easy packaging. Maybe via jpackage in the future.

I've written a simple rendering engine already, and looks like I love to write these kinf of tools rather than writing games... Smiley
Thanks for your feedback!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online yboya
« Reply #3 - Posted 2020-02-05 19:13:49 »

Hi,

I watch your work with attention, as I am trying to do approximately the same thing, my own game engine in java, with Koin3D project.

I will try to run your game to get ideas  Smiley
Offline philfrei
« Reply #4 - Posted 2020-02-06 04:42:18 »

  • A very simple sound system

If you'd like to use AudioCue, please do so.

AudioCue is basically a souped-up Clip, slightly easier to invoke, with real-time volume, panning and pitch controls, as well as allowing concurrent playback. There are also line followers allowing one to trigger events on starts and stops.

As far as multi-platform compatibility: I wrote an Android wrapper for audio output from Java once before. I've worked on but not completed a wrapper that would work with lwjgl. But these should be surmountable tasks.

music and music apps: http://adonax.com
Offline mudlee
« Reply #5 - Posted 2020-03-08 19:47:13 »

As I "promised" I started to work on it, here is the current status of the project: it's on Github now! Smiley

Link: https://github.com/mudlee/spck-framework

As I have time, I continue to work on this will see, where it ends up.
Offline CommanderKeith
« Reply #6 - Posted 2020-03-09 23:05:59 »

Looks interesting with the LWJGL BGFX Direct3D stuff. Does that work yet? Can you paint using Direct3D?
EDIT:
Quote
cross platform (opengl, vulkan, metal, directx) rendering via bgfx (through lwjgl), currently desktop only - done
Ooops, I see that it does! Nice one. For years we've lacked D3D via Java, so this is quite remarkable.
What's the performance of D3D like compared to OpenGL?

Offline mudlee
« Reply #7 - Posted 2020-03-10 05:49:03 »

Unfortunately (haha) I have no windows to test it, but according to the number of users using bgfx without any problem I suppose there is no performance issue at all. My project is in the very early stage, so everything is possible.
Offline mudlee
« Reply #8 - Posted 2020-04-25 17:20:43 »

I found this series on YT: https://www.youtube.com/watch?v=JxIZbV_XjAs&list=PLlrATfBNZ98dC-V-N3m0Go4deliWHPFwT

This guy is fckin' awesome. He works at EA and he's been creating engines since years. So I got inspired and continued this thing what I started to first refactor that even BGFX is a rendering backend only.

Not yet done, but I see the light in the end of the tunnel now. Also, I'm getting used to bgfx and abstract rendering concepts. First goal is to have this spck framework in a state where anyone can use it for cross-platform rendering via vertex/index buffers and shaders. Then, I'd expand it with other stuff, I think for 2D mainly.
Offline mudlee
« Reply #9 - Posted 2020-04-26 17:59:57 »

And today the main refactor is done. Now I can create a packagable (jlink) java 11 app, which can render vertex arrays via bgfx. On OSX with metal, on linux with opengl/vulkan, on windows with dx.

https://drive.mudlee.hu/spck.png

Next goal is cameras, then load a cube (easy) and submit a Mesh (with material) to the renderer. I might also write an automation that compiles bgfx's shaders automatically into glsl and metal.

Currently, the client code is something like this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
...
public void initialized() {
   Shader shader = Shader.create("vs_cubes", "fs_cubes");

   VertexBufferLayout vertexBufferLayout = new VertexBufferLayout(
      new VertexLayoutAttribute(0, 3, Renderer.dataType.FLOAT,false),
      new VertexLayoutAttribute(4, 4, Renderer.dataType.FLOAT,false)
   );

   VertexArray vertexArray = VertexArray.create();
   vertexArray.addVertexBuffer(VertexBuffer.create(triVert, vertexBufferLayout));
   vertexArray.setIndexBuffer(IndexBuffer.create(triInd));

   triangle = SubmitCommand.indexed(vertexArray,shader, "Triangle");

   window.input.onKeyPressed(GLFW_KEY_ESCAPE,event -> stop());
}

public void update(Event event) {
   Renderer.startScene();
   Renderer.setClearColor(Color.RED); // not yet working
   Renderer.clear();
   Renderer.submit(triangle);
   Renderer.endScene();
}
...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mudlee
« Reply #10 - Posted 2020-04-29 15:53:55 »

In the last couple of days I started to write a more standard shader solution as I really don't like bgfx's glsl like approach.

I successfully created a process (not yet commited) where from glsl I can create a spir-v intermediate, which I can use to create hlsl and msl shaders.

QUESTION

I have some problem and went down to debugging and I just found that if I pass a valid program, but the shaders are messed up (syntax error for eg), still I get a triangle (but without colors). Even if I pass a random short to bgfx's submit, it still renders my triangle. What???
Any idea how this works? Does it just drops all shaders it gets if it's invalid?

1  
2  
var random_short = 0;
bgfx_submit( 0, random_short, 0, false);
Offline mudlee
« Reply #11 - Posted 2020-04-30 07:12:13 »

If anyone interested, I got an answer here: https://github.com/bkaradzic/bgfx/issues/2126

I'm not sure if it's a good cross-platform renderer, where you have to rely on an undocumented shader language like the BGFX's GLSL like one. Sad
Offline princec

« JGO Spiffy Duke »


Medals: 1146
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #12 - Posted 2020-04-30 08:41:59 »

In an ideal world... we'd be able to write shaders in Java and transpile the bytecodes to SPIR-V somehow.

Cas Smiley

Offline mudlee
« Reply #13 - Posted 2020-04-30 08:57:33 »

I even can do that but until I have to convert it to bgfx's format and it's like a mess without proper doc. Its good that even minevraft uses it, but the lack of documentation scares me a bit. As I mentioned with SPIRV-Cross it's enough to write the shader in glsl, and it can transpile it to hlsl/msl/vulkan, but looks like I have to write a converter to bgfx if I want to stick with it.
Offline Spasi
« Reply #14 - Posted 2020-04-30 10:38:18 »

There's some documentation on bgfx shaders here:

https://bkaradzic.github.io/bgfx/tools.html#shader-compiler-shaderc

You can download the bgfx tools from the file browser on the LWJGL website. For example:

https://www.lwjgl.org/browse/nightly/windows/x64/bgfx-tools
Offline mudlee
« Reply #15 - Posted 2020-04-30 11:27:50 »

Yes I know both and I already created two sh/gradle tasks
- one uses shaderc from bgfx-tools
- one uses spirv-cross

Obviously I tried the second one integrate into this framework as I think people would like to use more standard GLSL shaders with khronos's compiler than bgfx's shaders and its tools.

So I think in the end I can endup with a solution but that will include bgfx toolings and I would rather trust khronos's compiler than bgfx's. That's all Smiley
Offline mudlee
« Reply #16 - Posted 2020-05-01 06:12:01 »

I might be wrong but I'll not use bgfx even though it looks really promising.

Reason(s):
- I did a few hour research yesterday and found out that this project exists for years now and the community is still very small. Basically, there is only one core committer.
- I found several reddit and gamasutra discussion where they mention that the author of the project constantly rejects standardization (I hope I write it right) they propose like standard shader language (which was my biggest complaint as well) or a proper build system. They also say that its code quality is questionable as well. I don't want to stay at any side, but I do see that the community isn't growing, even though there are production projects based on that.
- Also I read multiple github issues (including mine) where I found that the guy's attitude is not the one I like to cooperate with. Here I don't want to be a puppy (or how do you say) but what I expect from such a project something like what the LWJGL guys do. They lead their community/forum/tech the best way I can imagine.

What will happen? I might give an another try to Vulkan, now I have more time than before, but as you see I can be very hectic. My goal is to still have a cross-platform framework/engine I can use for the next LD jam. I'll get back here if anything changes.
Pages: [1]
  ignore  |  Print  
 
 

 
Riven (843 views)
2019-09-04 15:33:17

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

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

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

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

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

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

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

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

nelsongames (5481 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

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
java-gaming.org 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‑gaming.org
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!