ThreeJs Integration

Not favoritedFavorited Favorited 0 favourites
  • 15 posts
From the Asset Store
This is a simple login feature to access Metamask in construct 3. Requires a Chrome Browser and Metamask Extension.
  • I Made plugin that integrates threejs seamlessly

  • Subscribe to Construct videos now
  • Cool! Is it possible to use Sprites and Sprite animations as textures in 3D objects or billboards?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Cool! Is it possible to use Sprites and Sprite animations as textures in 3D objects or billboards?

    Yes you can. threejs provides sprite image which is billboard

  • Sorry, I didn't express myself clearly.

    I know that ThreeJS has a Sprite object, but can your Plugin "link" the animations of a Construct3 Sprite with a THREE.Sprite material/texture?

    Or do I have to manage THREE.SpriteMaterial textures separately?

    I'm asking this based on how convenient it is to use the C3 Sprite sheet editor and animation events/actions. If we have to manage external sprite sheet textures, it would be a real hassle.

  • Got it, That is something I have to explore. I will check is there any way or workaround to link those sprite animations

  • I'm asking this based on how convenient it is to use the C3 Sprite sheet editor and animation events/actions. If we have to manage external sprite sheet textures, it would be a real hassle.

    You can use sprites normally because my plugin supports layers.You can create 3d scene on any layer you want and in upper layer you can have overlay sprite animations

  • I'm not asking about having C3 Sprites in another layer. I know that's possible (like in this example).

    My question is about a billboard sprite in the ThreeJS layer, leveraging C3 Sprite object, texture, and animations, in such a way that it is rendered in ThreeJS (casting shadows, and reacting to lights).

    This screenshot from Octopath Traveler shows what I mean:

    This video shows something similar in motion:

    youtu.be/-xLl1PLPGS0

    (notice how the sprite casts and receives shadow)

    Other commercial titles with this aesthetic: Songs of Conquest, Eiyuden Chronicle, Grandia HD, Paper Mario, Book of Travels, Cassette Beasts, REPLACED, Songs of Glimmerwick.

    In theory, if you can access C3's Sprite Object animation frames and texture via C3 SDK, you'd be able to sync it with the THREE.SpriteMaterial, right?

    If this were possible, I would gladly pay a lot for the plugin!

  • In theory, if you can access C3's Sprite Object animation frames and texture via C3 SDK, you'd be able to sync it with the THREE.SpriteMaterial, right?

    Oh I got it. this is gonna be quite a challenge with new v2 sdk but I will try my best to achieve this. Lets see....

  • According to the SDKv2 docs, IObjectType.GetImage() returns an IAnimationFrame, which has GetCachedWebGLTexture() and GetTexRect()

    It won't be easy, cause you'd have to juggle the TextRect of the sprite being rendered... but it would be a fantastic feature to have, and it would unlock a whole new realm of possibilities.

    I think there's a shader to render part of a texture here github.com/knowercoder/threejs-sprite-utils (animated sprite)

  • You probably will run into a snag in that c3 and threejs each have their own rendering contexts and you can’t share the same texture between contexts. What you’d end up needing to do is copy the texture to memory from one context and load that into the other context. Memory wise you’ll be loading the texture twice and speed wise transferring images to and from vram is rather slow. So you likely will want to do that selectively.

    Generally most of the time when integrating a different renderer with construct they each would have their own unique context so the above is pretty unavoidable. In theory you could have two different renderers operate with the same context to be able to share resources. But in practice it’s not really feasible since the renderers with conflict with each other a lot so you’d need to juggle rendering state.

  • [...] you can’t share the same texture between contexts. What you’d end up needing to do is copy the texture to memory from one context and load that into the other context. Memory wise you’ll be loading the texture twice

    Indeed. I can live with using double the RAM of the spritesheets containing shared Sprite Object. This shouldn't be a big deal for most projects.

    speed wise transferring images to and from vram is rather slow. So you likely will want to do that selectively.

    I agree with transferring images selectively. Speed wouldn't be an issue since the Texture would have to be copied only once per spritesheet, and then only the TextRect (coordinates) would have to be synced across contexts.

  • According to the SDKv2 docs, IObjectType.GetImage() returns an IAnimationFrame, which has GetCachedWebGLTexture() and GetTexRect()

    I dit not find those in logs? are they changed?

  • I haven't developed an Addon yet, so I might be mistaken.

    From what I understand, C3 has two IObjectType:

    1. IObjectType Script Interface
    2. IObjectType SDK Interface

    From your screenshot, it seems like you're viewing the non-SDK API. My understanding is that from within your Addon you should be able to access the SDK API.

    What do you think?

  • From your screenshot, it seems like you're viewing the non-SDK API. My understanding is that from within your Addon you should be able to access the SDK API.

    What do you think?

    Yeah, I don't know much about this sdk so I confused with runtime objecttype instead of looking in editor api. I will see

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)