January 25, 2021, 01:35:27 PM

Author Topic: Vortex2 beta released - 3D module  (Read 25218 times)

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: Vortex2 beta released - 3D module
« Reply #15 on: October 06, 2017, 04:56:15 PM »
I decided to give it another go and the converter to MonkeyX is awesome btw as I got to build the latest and run the demos on desktop and web again without any problems.

Here's the CatLog for the android build filtered out with Errors only if you're curious to find out this issue that I am having. This is running the simple triangle demo just to test out the very basics of this module for android.

Code: [Select]
10-06 11:40:54.082 E/AndroidRuntime(4110): in writeCrashedAppName, pkgName :com.monkeycoder.monkeygame
10-06 11:40:54.082 E/AndroidRuntime(4110): FATAL EXCEPTION: GLThread 188
10-06 11:40:54.082 E/AndroidRuntime(4110): Process: com.monkeycoder.monkeygame, PID: 4110
10-06 11:40:54.082 E/AndroidRuntime(4110): java.lang.NumberFormatException: Invalid float: "OpenGL"
10-06 11:40:54.082 E/AndroidRuntime(4110): at java.lang.StringToReal.invalidReal(StringToReal.java:63)
10-06 11:40:54.082 E/AndroidRuntime(4110): at java.lang.StringToReal.initialParse(StringToReal.java:114)
10-06 11:40:54.082 E/AndroidRuntime(4110): at java.lang.StringToReal.parseFloat(StringToReal.java:304)
10-06 11:40:54.082 E/AndroidRuntime(4110): at java.lang.Float.parseFloat(Float.java:300)
10-06 11:40:54.082 E/AndroidRuntime(4110): at com.monkeycoder.monkeygame.c_Renderer.m_Init(MonkeyGame.java:5068)
10-06 11:40:54.082 E/AndroidRuntime(4110): at com.monkeycoder.monkeygame.c_World.m_Init(MonkeyGame.java:4599)
10-06 11:40:54.082 E/AndroidRuntime(4110): at com.monkeycoder.monkeygame.c_TestApp.p_OnCreate(MonkeyGame.java:3427)
10-06 11:40:54.082 E/AndroidRuntime(4110): at com.monkeycoder.monkeygame.c_GameDelegate.StartGame(MonkeyGame.java:3549)
10-06 11:40:54.082 E/AndroidRuntime(4110): at com.monkeycoder.monkeygame.BBGame.StartGame(MonkeyGame.java:558)
10-06 11:40:54.082 E/AndroidRuntime(4110): at com.monkeycoder.monkeygame.BBAndroidGame.onDrawFrame(MonkeyGame.java:1367)
10-06 11:40:54.082 E/AndroidRuntime(4110): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523)
10-06 11:40:54.082 E/AndroidRuntime(4110): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)


Thanks.

Offline Derron

  • Hero Member
  • *****
  • Posts: 3333
Re: Vortex2 beta released - 3D module
« Reply #16 on: October 06, 2017, 08:59:39 PM »
Seems something is trying to read a value which is no valid float (parseFloat()).


The "Init()" method of the Renderer-class is calling it - so I think it should be possible to debug that out properly (eg. do some debug-outputs (Log.i("yourapp", "here i am")).


Also you could check line :5068 if your created MonkeyGame.java-file and check what is happening there, and which line it "might" be in your original code.




bye
Ron

Offline JaviCervera

  • Jr. Member
  • **
  • Posts: 31
Re: Vortex2 beta released - 3D module
« Reply #17 on: October 06, 2017, 10:41:21 PM »
I'd bet the error is happening when trying to retrieve the supported GL version. I will make a fix for that. I'm out of home this weekend, but I will definitely fix it next week.

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: Vortex2 beta released - 3D module
« Reply #18 on: October 07, 2017, 02:10:39 AM »
Thanks Derron. I did not bother to check and debug it further at first by following those error trails as I would assume that the crash was a bigger issue than expected, which now seems to be the case (see below).

Thanks Javi, I did a quick fix by having a simple value for those version floats and that error went away. I'm now getting a force stop without errors |E| but just an info |I| with an error message

Code: [Select]
[Monkey] Error: Vertex shader active uniforms exceed MAX_VERTEX_UNIFORM_VECTORS (253)

Offline JaviCervera

  • Jr. Member
  • **
  • Posts: 31
Re: Vortex2 beta released - 3D module
« Reply #19 on: November 07, 2017, 12:11:53 PM »
Sorry for the delay in replying.

You could reduce the number of uniforms needed by decreasing the number of maximum lights and bones supported in World.Init. The function has the following signature:

Code: [Select]
Function Init:Bool(numLights:Int = 4, numBones:Int = 75)
So if you don't need lights or animation, you should reduce those numbers, for example:

Code: [Select]
World.Init(1, 0) 'One light supported, no bones

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: Vortex2 beta released - 3D module
« Reply #20 on: November 08, 2017, 02:07:42 PM »
Sorry for the delay in replying.

You could reduce the number of uniforms needed by decreasing the number of maximum lights and bones supported in World.Init. The function has the following signature:

Code: [Select]
Function Init:Bool(numLights:Int = 4, numBones:Int = 75)
So if you don't need lights or animation, you should reduce those numbers, for example:

Code: [Select]
World.Init(1, 0) 'One light supported, no bones

No worries Javi. I tried this again earlier without any bones and lights and I got this error.

Code: [Select]
Error: Could not pack varying fcubeCoords
Technically the device is not that outdated to not handle lights. I can run other 3D engine stuff like minib3d with multiple lights and bone animation, and other mobile 3d games with shaders and so this is quite surprising. I'm just guessing that this has something to do with the GLES implementation or related to that.


Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: Vortex2 beta released - 3D module
« Reply #21 on: November 08, 2017, 02:28:18 PM »
Btw, with those new shadows features, are those stencil or textured?

Offline JaviCervera

  • Jr. Member
  • **
  • Posts: 31
Re: Vortex2 beta released - 3D module
« Reply #22 on: November 08, 2017, 02:37:57 PM »
They are texture shadows.

BTW, I will take a further look at the problem you comment. It seems like the varying vars used have also reached the maximum available on your device.

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: Vortex2 beta released - 3D module
« Reply #23 on: November 09, 2017, 01:36:43 PM »
They are texture shadows.

BTW, I will take a further look at the problem you comment. It seems like the varying vars used have also reached the maximum available on your device.

Thanks, always nice to have textured shadows.

Offline JaviCervera

  • Jr. Member
  • **
  • Posts: 31
Re: Vortex2 beta released - 3D module
« Reply #24 on: November 30, 2017, 01:20:11 AM »
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

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: Vortex2 beta released - 3D module
« Reply #25 on: November 30, 2017, 12:25:55 PM »
Awesome update, cool stuff and big thanks to SLotman for the mobile fix!

@Javi

As I have posted in the CX forums, it would be nice to toggle some shader "varying" in case you prefer to use specific shaders on mobiles.

BTW, how would I enable a basic car paint effect on Vortex2? would that just be using reflection and refraction with some specular on the side?

cheers.

Offline JaviCervera

  • Jr. Member
  • **
  • Posts: 31
Re: Vortex2 beta released - 3D module
« Reply #26 on: December 01, 2017, 11:53:27 AM »
@RonTek: I am working on it. Check the Cerberus-X forums :)

For a car paint effect, you should use a reflection map with specular (which in beta2 can be defined in a texture also). I'll make a demo for beta2 with this :)

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: Vortex2 beta released - 3D module
« Reply #27 on: December 02, 2017, 12:39:47 PM »
@RonTek: I am working on it. Check the Cerberus-X forums :)

For a car paint effect, you should use a reflection map with specular (which in beta2 can be defined in a texture also).

Thanks Javi. :) Yes, I would suggest something like setting up a custom profile and some short guide on how to enable each of these settings.

Example:
Code: [Select]
#OPENGLES_SHADER_PROFILE = "Minimal"
and of course you can also create your own and set it up. For example, I would just like to have a basic diffuse and cube map for basic car paint for mobile or other reflective or shiny stuff. How would I go about this if it is currently not even an option? ..and so I think creating custom profiles or having flags for each could help with shader preference.

Quote
I'll make a demo for beta2 with this :)

That would be awesome, thanks.

Offline JaviCervera

  • Jr. Member
  • **
  • Posts: 31
Re: Vortex2 beta released - 3D module
« Reply #28 on: December 04, 2017, 12:39:56 AM »
I have been playing with a model from Sketchfab:

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: Vortex2 beta released - 3D module
« Reply #29 on: December 04, 2017, 10:05:02 PM »
I have been playing with a model from Sketchfab:

Looks good. Is this with the environment mapping?

Btw, I was wondering how it would be easy to integrate 2D frameworks or standard mojo 2D commands on top. Does it need some refactoring or I could just use it directly? thanks.

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal