• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

Vortex2 beta released - 3D module

JaviCervera

Member
3rd Party Module Dev
Joined
Jul 12, 2017
Messages
81
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:
Looking forward to give it a full run for its money now. Thank you!!! :)
 
Nice, thanks so much!
 
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
 
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.
 
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
 
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 :/
 
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:
@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?
 
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:
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:
@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:
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:
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.
 
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.
 
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.
 
Something I have been playing with:

hovercraft.png
 
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).

 
Back
Top Bottom