Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Crash on Android running 3D-Anim sample — Gideros Forum

Crash on Android running 3D-Anim sample

@hgy29:

I've been working on a 2D/3D hybrid game, and ran into an issue with the 3D animation that effects my app as well as the 3D-Anim sample application. If I do a full export to Android, it just crashes. If I export as a player and run there, I get this error:

GL_OES_texture_view GL_EXT_fragment_invocation_density GL_QCOM_validate_shader_binary GL_QCOM_YUV_texture_gather "
glsl
FragmentShader:
ERROR: 0:19: 'sampler2DShadow' : Reserved word.
ERROR: 0:19: 'sampler2DShadow' : Syntax error: syntax error
INTERNAL ERROR: no main() function!
ERROR: 2 compilation errors. No code generated.



stack traceback:
3dbase/3DLighting.lua:74: in function 'getShader'
3dbase/3DLighting.lua:109: in function 'setSpriteMode'
3dbase/3DShapes.lua:32: in function 'updateMode'
main.lua:23: in main chunk

This only seems to happen for apps that don't use animated 3D meshes. I've tried with version 2020.5.1, but not yet with 2020.7.

Any ideas?

Paul

Comments

  • hgy29hgy29 Maintainer
    Accepted Answer
    I had a similar issue recently and I had to tinker with the shader code. I didn’t push my changes to 2020.7 though, since I was unsure. I will try to recover them. The issue is related to shadows, it should disappear if you disable shadows.
  • PaulHPaulH Member
    Thanks! I just commented out the SHADOWS line in 3DLighting.lua and it works fine. For my purposes, that's just fine.

    The 3D animation is really helpful for my current project. I'm working on a new game using 3D assets for 2D gameplay. The game poses and animates 3D models, drawing them onto RenderTargets to create sprites, then using those for all the real-time graphics. The goal to get 3D-like graphics in a 2D game that can run well even on older devices.

    Thanks again,

    Paul

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • @PaulH could you help me (us) exporting animations from blender. I tried it but I don't know how to set up blender to export my anims to use in gideros :-(
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • a quick tuto could be really helpful.
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • PaulHPaulH Member
    I'll see what I can come up with. I exported my models late last year, then put this project on hold until a couple months ago. I just had a look at my notes from when I got the exported models working and I see I'm missing a step or two, so I'll have to figure that out again myself.

    Paul

  • PaulHPaulH Member
    Maybe my notes were complete after all. They use an external tool, fbx-conv: https://github.com/libgdx/fbx-conv

    The steps I used were:

    Export the model from Blender as an FBX file.
    Copy it to a folder with the fbx converter tool.
    Use this command line to convert the fbx model to a JSON file, assuming you exported a file called the_model.fbx, and want to create the_model.json:

    fbx-conv-win32 -v -o G3DJ the_model.fbx the_model.json

    In Gideros, see the 3d-anim example. Load the_model.json the same way. Don't load the animations separately - they are included within the model.

    When calling setAnimation, the example uses the parameter "main". That's arbitrary, and is just used as an internal index. So use one that's
    unique to each animation, i.e. a name of what the animation does.

    Likes: MoKaLux, antix

    +1 -1 (+2 / -0 )Share on Facebook
  • super cool, thanks PaulH.
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • MoKaLuxMoKaLux Member
    edited December 2020
    PaulH said:

    Don't load the animations separately - they are included within the model.

    When calling setAnimation, the example uses the parameter "main". That's arbitrary, and is just used as an internal index. So use one that's unique to each animation, i.e. a name of what the animation does.

    I am trying 3d animation. The steps above works great but I am stuck loading the animations :o
    -- Load two animations from g3dj files
    local animWalk=buildGdx("Animations/walk.json",{})
    local animIdle=buildGdx("Animations/idle.json",{})
    -- Default animation is idle
    -- note that in our files, first animation in array the T-pose, the second is the real anim
    D3Anim.setAnimation(m,animIdle.animations[2],"main",true)
    I don't know what to put instead of animIdle.animations[2] if my animation is in the same file as my model.

    Please find my simple 3d animation json file which output looks very similar to the original 3d animation demo.

    Some help please please please :)

    What I have tried among other things:
    local animWalk=buildGdx("test01.json",{})
    D3Anim.setAnimation(m,animWalk.animations[1],"Armature|move1",true)
     
    local walk,wang=false,0
    stage:addEventListener(Event.MOUSE_DOWN,function()
    	D3Anim.setAnimation(m,animWalk.animations[1],"Armature|move1",true,0.5)
    	walk=true
    end)
    stage:addEventListener(Event.MOUSE_UP,function()
    	D3Anim.setAnimation(m,animWalk.animations[1],"Armature|move1",true,0.5)
    	walk=false
    end)
    error:
    3dbase/3DAnimation.lua:11: attempt to index local 'b' (a boolean value)
    stack traceback:
    3dbase/3DAnimation.lua:11: in function 'updateBones'
    3dbase/3DAnimation.lua:112: in function 'tick'
    main.lua:78: in function


    What is supposed to be in local name=b.name?

    blender 2.91 fbx-conv_2020_03 gideros 2020.11.1
    zip
    zip
    3D-Anim.zip
    281K
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    @MoKaLux, it looks like you are hitting another case of 'order of apparition issue'. I will fix G3DFormat.lua to cope with that

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    Use the patched version attached.
    Also scale down your model
    m:setScale(0.002,0.002,0.002)
    lua
    lua
    G3DFormat.lua
    10K

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • MoKaLuxMoKaLux Member
    edited December 2020
    PERFECT THANK YOU CAPTAIN
    :) IT IS MOVING :)
    <3 <3 <3 <3 <3 <3 <3 <3 <3
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • FYI texturing seems to be broken in the official gideros 3d anim example.
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    Yes, I know, it is already fixed :)

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.