Tiny Thor (made with Monkey X)
Develop on Windows or OSX and deploy easily
Crypt of the Necrodancer (made with Monkey X)
New Star Soccer - BAFTA Winner 2013!!! (made with Monkey X )
Ted - The code editor of Cerberus X
Avalon Legends (made with Monkey X)
Race Time (made with Monkey X)

Vortex2 beta released - 3D module

JaviCervera Aug 31, 2017

Tags:
  1. JaviCervera

    JaviCervera Member 3rd Party Module Dev

    Messages:
    61
    Likes Received:
    59
    Trophy Points:
    18
    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: Aug 31, 2017
    Ferret3D, Martin, zxretrosoft and 2 others like this.
  2. MikeHart

    MikeHart Administrator Staff Member Administrator Moderator

    Messages:
    1,237
    Likes Received:
    300
    Trophy Points:
    83
    Looking forward to give it a full run for its money now. Thank you!!! :)
     
  3. Martin

    Martin Administrator Administrator Moderator

    Messages:
    263
    Likes Received:
    147
    Trophy Points:
    43
    Nice, thanks so much!
     
  4. zxretrosoft

    zxretrosoft New Member

    Messages:
    18
    Likes Received:
    4
    Trophy Points:
    3
    Great work, thanks! :)
     
  5. Ferret3D

    Ferret3D Member

    Messages:
    89
    Likes Received:
    20
    Trophy Points:
    8
    Great job!
     
  6. Alvaro Celis

    Alvaro Celis New Member

    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    3
    Hi Javi, thanks for this great Module. When I rebuild the documentation I get the following warning with regards to vortex:
    Code (Cerberus X):
    1. Making apis...
    2. vortex.Font  :  Can't find link:Glyph
    Is there a way to fix it?

    regards,
    Alvaro
     
  7. JaviCervera

    JaviCervera Member 3rd Party Module Dev

    Messages:
    61
    Likes Received:
    59
    Trophy Points:
    18
    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.
     
    Alvaro Celis likes this.
  8. Alvaro Celis

    Alvaro Celis New Member

    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    3
    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
     
    zxretrosoft likes this.
  9. SLotman

    SLotman New Member

    Messages:
    25
    Likes Received:
    4
    Trophy Points:
    3
    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 :/
     
  10. SLotman

    SLotman New Member

    Messages:
    25
    Likes Received:
    4
    Trophy Points:
    3
    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: Nov 23, 2017
  11. MikeHart

    MikeHart Administrator Staff Member Administrator Moderator

    Messages:
    1,237
    Likes Received:
    300
    Trophy Points:
    83
    @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?
     
  12. SLotman

    SLotman New Member

    Messages:
    25
    Likes Received:
    4
    Trophy Points:
    3
    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: Nov 23, 2017
    RonTek likes this.
  13. SLotman

    SLotman New Member

    Messages:
    25
    Likes Received:
    4
    Trophy Points:
    3
    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: Nov 27, 2017
  14. JaviCervera

    JaviCervera Member 3rd Party Module Dev

    Messages:
    61
    Likes Received:
    59
    Trophy Points:
    18
    @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: Nov 30, 2017
    RonTek likes this.
  15. MikeHart

    MikeHart Administrator Staff Member Administrator Moderator

    Messages:
    1,237
    Likes Received:
    300
    Trophy Points:
    83
    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: Nov 30, 2017
  16. JaviCervera

    JaviCervera Member 3rd Party Module Dev

    Messages:
    61
    Likes Received:
    59
    Trophy Points:
    18
    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.
     
    MikeHart likes this.
  17. RonTek

    RonTek Member

    Messages:
    35
    Likes Received:
    3
    Trophy Points:
    8
    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.
     
    MikeHart likes this.
  18. JaviCervera

    JaviCervera Member 3rd Party Module Dev

    Messages:
    61
    Likes Received:
    59
    Trophy Points:
    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.
     
    MikeHart likes this.
  19. JaviCervera

    JaviCervera Member 3rd Party Module Dev

    Messages:
    61
    Likes Received:
    59
    Trophy Points:
    18
    Something I have been playing with:

    hovercraft.png
     
    RonTek and MikeHart like this.
  20. RonTek

    RonTek Member

    Messages:
    35
    Likes Received:
    3
    Trophy Points:
    8
    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).