Vortex2 beta released - 3D module

JaviCervera

Member
3rd Party Module Dev
Joined
Jul 12, 2017
Likes
60
#1
Hello Cerberus-X community.

I am proud to announce that Vortex2 has reached beta stage and has been officially published. It is a 3D module for Cerberus-X with a syntax inspired by Blitz3D (although being object oriented).

You can download a source snapshot or binary versions (with the tools precompiled) for Windows, macOS and Linux here:

https://github.com/JaviCervera/vortex/releases/tag/v2.0-beta

Or you can simply clone the repository to be up-to-date with future changes. Those who have been following the development of the module on the "vortex2" branch of the repository, please switch to the default "master" branch, which will be the active one from now on.

Checks the programs in the "demos" and "tests" directories. Demos showcase what can be achieved with the engine, while tests are simple programs that show how to use specific features of Vortex.

Please have in mind that this is pre-release software, so it may be buggy, and some features still need lots of work (specially shadows).

Thank you for your support!


 
Last edited by a moderator:
Joined
Nov 8, 2017
Likes
1
#6
Hi Javi, thanks for this great Module. When I rebuild the documentation I get the following warning with regards to vortex:
Code:
Making apis...
vortex.Font  :  Can't find link:Glyph
Is there a way to fix it?

regards,
Alvaro
 

JaviCervera

Member
3rd Party Module Dev
Joined
Jul 12, 2017
Likes
60
#7
Sorry for the delay, Alvaro.

You can safely ignore that, it simply means that the Glyph class is not documented while it is used inside one parameter of one of the methods in the Font class. That is used internally by the engine, but you shouldn't need it unless you are writing your custom font loader.
 
Joined
Nov 8, 2017
Likes
1
#8
You can safely ignore that, it simply means that the Glyph class is not documented while it is used inside one parameter of one of the methods in the Font class. That is used internally by the engine, but you shouldn't need it unless you are writing your custom font loader.
Thanks a lot Javi. Good to know. I used to work with Irrlicht long time ago, it's great you've implemented 3d model loading through it. I'm checking your examples to learn how to load stuff.

Thanks for your hard work.

regards,
Alvaro
 
Joined
Jul 3, 2017
Likes
4
#9
Looking good! Tried it on desktop, and it ran flawlessly! Same with HTML5!

...but tried on Android, and even the 'triangle" sample wouldn't run... just a black screen, then back to home screen. (On a Samsumg Galaxy Tab 4). Tried also on a crappy ZTE phone (also Android 4.x) and same behaviour.

Tried on a "bluboo mini" (android 6.x) and same thing.

Some debug info:

Galaxy Tab 4:
Vendor name: Vivante Corporation
Renderer name: Vivante GC1000
API version name: OpenGL ES 2.0
Shading version name: OpenGL ES GLSL ES 1.00

Shader just outputs "Error:" and nothing else.

Bluboo Mini:
Vendor name: ARM
Renderer name: Mali-400 MP
API version name: OpenGL ES 2.0
Shading version name: OpenGL ES GLSL ES 1.00

Shader output:
Error:
0:3: P0004: High precision not supported, instead compiling high precision as medium precision
0:1: L0006: Out of varying space. Mali-400 PP provides space for 12 varying vec4s, this shader uses 14 varying vec4s.

Hope this helps in any way. I tried experimenting with the shader... but since I had no idea of what I was doing, I got zero progress on anything :/
 
Joined
Jul 3, 2017
Likes
4
#10
Weird. With World.init(0,0) it ran on the ZTE phone! o_O

ZTE info:
Vendor name: Qualcomm
Renderer name: Adreno (TM) 305
API version name: OpenGL ES 3.0 V@66.0 AU@04.04.02.048.037 (CL@3304448)
Shading version name: OpenGL ES GLSL ES 3.00

Made some more tests, it supports World.init(4,54); If I increase 1 more bone, it crashes.
 
Last edited:

MikeHart

Administrator
Staff member
Joined
Jun 19, 2017
Likes
400
Location
Germany
#11
@JaviCervera I hate to bug you again, but is there any chance you could add object picking? I don't need collision checks for my game. Just the ability to click on the screen with the mouse and detect the object I have clicked on.
Tool wise I have only AGK as an option for my game Card Rogues. I would love to port it to CX as it is the only tool, besides AGK that runs decent on my low end system.

Another question. Can objects/meshes created on the fly and also can textures be changed at runtime?
 
Joined
Jul 3, 2017
Likes
4
#12
So... the problem both with the Tab4 and the Bluboo mini is the ammount of "varying" on the shader.

I just changed the shader to this:

Const STD_VARYING_VARS:String = "" +
"varying vec3 fpos;" +
"vec3 fposNorm;" +
"varying vec3 fnormal;" +
"varying vec4 fcolor;" +
"varying vec2 ftex;" +
"varying vec2 ftex2;" +
"varying vec3 fcombinedDiffuse;" +
"vec3 fcombinedSpecular;" +
"float fogFactor;" +
"vec3 fcubeCoords;" +
"vec3 freflectCoords;" +
"vec3 frefractCoords;" +
"vec3 fdepthCoords;" +
"varying mat3 tbnMatrix;"

I know, I'm losing reflection, refraction, diffuse, specular.... I just wanted to get it running - and it did. Like that it runs both on the Bluboo mini and the Galaxy Tab4 (The Tab4 is awful - the triangle demo is running at 24 fps! But it is running...)

Maybe some of this could be rewritten to use less 'varying's?

update: with World.Init(4,50) and the shader above, I could run almost every demo. Of course, the "shadow" demo had no shadows - but other than that, everything pretty much worked. The only one who didn't ran was the "mars" one.
 
Last edited:
Joined
Jul 3, 2017
Likes
4
#13
Maybe this could replace the original shader?

Again, I'm far from qualified to do this, so I don't know if I broke something important... but this shader runs in the Bluboo mini/Mali-400 GPU - and I saw no differences from the regular one (can someone please verify this?)

Worst case, maybe this could be used as a "degraded" shader? If the original one doesn't compile, then it tries this one I made? Or defaults to it, if running on mobile/android?

Still, no luck getting it to run on my Samsung Galaxy Tab 4, needs further changes to do so :(
 
Last edited:

JaviCervera

Member
3rd Party Module Dev
Joined
Jul 12, 2017
Likes
60
#14
@MikeHart:
I will add object picking for beta2.

You can create meshes on the fly:

- Create a surface with New Surface
- AddVertex, AddTriangle, etc on the surface
- Create a mesh with New Mesh
- Add the surface to the mesh with mesh.AddSurface(surface)

You can create textures on the fly, but only to be used as render targets. I will add a SetPixels method at some point.

I will work on screen picking before beta2.

@SLotman:
Thank you very much for your report! I will take a look and see if I can get rid of some vars in the shader without breaking anything. If I can't, maybe I should give the option to activate a minimal shader which misses some features but that would work on low end devices.

I have commited a few changes to Github, basically now Vortex supports specular textures, so a surface does not need to have uniform shininess anymore. The robot demo has been updated to use a specular texture, and I think it looks much better now.

Here are some of the changes I want to make before beta2, which should be released by the end of the year:

- Add Lighting and ReceiveShadows properties to Material
- Add Shader property to Material
- Add picking test
- Add Texture.SetPixels method
- Add fixes for Android
 
Last edited:

MikeHart

Administrator
Staff member
Joined
Jun 19, 2017
Likes
400
Location
Germany
#15
Thanks @JaviCervera that would be awesome. Is it possible to load a texture and set it to a manually created mesh? That is what I ment regarding texture.
 
Last edited:

JaviCervera

Member
3rd Party Module Dev
Joined
Jul 12, 2017
Likes
60
#16
Sure. Once you have created the mesh, you can do mesh.Material(0).ColorTexture = Cache.LoadTexture("filename").

This would change the texture for every model in your world that uses the mesh. If you just want to change the texture in one of the models using the mesh, do:

model.Material(0).ColorTexture = Cache.LoadTexture("filename")

To procedurally create a mesh, check the "test_triangle.cxs" file. The info I provided on my previous post regarding how to procedurally create a mesh was not correct, sorry. I have edited the post.
 
Joined
Jun 22, 2017
Likes
3
#17
Thanks SLotman for the mobile fix. Got it working now on my phone as well! :)

Great update Javi! it would be nice to have what SLotman is suggesting, or maybe you can configure these shader options or flags on mobile? say you would just like to enable only diffuse, normal and environment (reflection/refraction??) for mobile, etc.

cheers.
 

JaviCervera

Member
3rd Party Module Dev
Joined
Jul 12, 2017
Likes
60
#18
Ok, I have added several shader types:

- Minimal: No normal or specular maps, no cube mapping, no shadows
- Minimal with shadows: No normal or specular maps, no cube mapping
- Vertex lighting: No normal or specular maps
- Pixel lighting: It is now the default mode if supported

I have removed the number of vars required even on pixel lighting mode, so hopefully all modes might work on Android! Anyway, as long as Vortex is capable of compiling the minimal shader, the app should launch.

I have commited these changes to Github, and will release beta2 really soon (I have postponed some of the features I was planning to a third beta, since I want an officially released version with Android support as soon as possible).

@SLotman I have uploaded a version of the module with these changes here:

https://www.dropbox.com/s/wn26hwkhkscjpue/vortex2_shaderfixes.zip?dl=0

Could you try at least "demos/demo_robot.cxs" and "tests/test_triangle.cxs" and tell me if they launch at all? You can touch the screen to change the shader mode, tell me which ones work. You can only switch between the correctly loaded ones, so please tell me which ones you can switch between.

Please tell me if they work on both the ZTE and the Tab4.
 
Joined
Jun 22, 2017
Likes
3
#20
Posted this error on SB as well, here's the error I'm getting on mobile setup:

I/[Monkey]( 3607): Error: Vertex shader active uniforms exceed MAX_VERTEX_UNIFORM_VECTORS (253).

 
Top Bottom