I have already got 2 texture atlases. One for the front of cards and one for the back which works fine. I’m now trying to add a 3rd for the normals and I get a crash…
I’m not sure what I have done wrong to cause this.
1 Like
AGulev
April 23, 2024, 1:37pm
2
The best you can do in such cases is try to isolate the crash in a separate small project, and then open an issue on the GitHub issue tracker (using Help > Report Issue
). Explain the problem there and attach your repro project to the issue + console log as a code block or just a txt file.
It will help us to track the issue. Using Help > Report Issue
provides most of the information we need. A repro case will help us to figure out what’s going on and fix the issue as soon as possible.
1 Like
I have uploaded a repro project for you to take a look at.
opened 09:32AM - 24 Apr 24 UTC
bug
**Describe the bug (REQUIRED)**
I have a sprite that represents a playing card … that has 2 textures. One for the front and one for the back so that I can swap them in the fragment shader.
Just adding a third sampler for a normal map, makes the game crash on running.
**To Reproduce (REQUIRED)**
Steps to reproduce the behavior:
1. Open game.project
2. Select Project>Fetch Libraries
3. Build and run ( you should see a card back)
4. Open assets/materials/card/card.material
5. Add a 3rd sampler to Samplers using "+" called normal_sampler with the same settings as the 2 other samplers
6. Open main/objects/card/card.go
7. Select "sprite" in the outline
8. Select "assets/atlases/AC_normal.atlas" [NB: it doesn't matter which atlas is chosen] for the normal_sampler
9. Build and run to observe the crash
**Expected behavior (REQUIRED)**
No crash
**Defold version (REQUIRED):**
1.7.0
**Platforms (REQUIRED):**
- Platforms: macOS
- OS: Sonoma
- Device: MacBook Pro 14" M1
**Minimal repro case project (OPTIONAL):**
[Defold_multitexture_bug.zip](https://github.com/defold/defold/files/15091955/Defold_multitexture_bug.zip)
**Logs (OPTIONAL):**
INFO:DLIB: Log server started on port 50093
INFO:ENGINE: Target listening with name: orac-2.local - 10.0.0.13 - Darwin
INFO:ENGINE: Engine service started on port 50094
INFO:GRAPHICS: Installed graphics device 'ADAPTER_FAMILY_OPENGL'
INFO:ENGINE: Defold Engine 1.7.0 (bf4dc66)
INFO:DLIB: Initialized Remotery (ws://127.0.0.1:17815/rmt)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device 'default'
Assertion failed: (i < Size()), function operator[], file array.h, line 494.
INFO:CRASH: Successfully wrote Crashdump to file: /Users/andy/Library/Application Support/Defold/_crash
ERROR:CRASH: CALL STACK:
ERROR:CRASH: 0 dmengine 0x000000010248cc88 _ZN7dmCrash7OnCrashEi + 104
ERROR:CRASH: 1 libsystem_platform.dylib 0x000000019f69b584 _sigtramp + 56
ERROR:CRASH: 2 libsystem_pthread.dylib 0x000000019f66ac20 pthread_kill + 288
ERROR:CRASH: 3 libsystem_c.dylib 0x000000019f577a20 abort + 180
ERROR:CRASH: 4 libsystem_c.dylib 0x000000019f576d10 err + 0
ERROR:CRASH: 5 dmengine 0x00000001024d73a8 _ZN12dmGameSystem16CompSpriteRenderERKN12dmGameObject22ComponentsRenderParamsE.cold.5 + 0
ERROR:CRASH: 6 dmengine 0x00000001022a2bc0 _ZN12dmGameSystem16CompSpriteRenderERKN12dmGameObject22ComponentsRenderParamsE + 2480
ERROR:CRASH: 7 dmengine 0x000000010225de3c _ZN12dmGameObject6RenderEPNS_16CollectionHandleE + 176
ERROR:CRASH: 8 dmengine 0x000000010224a3e4 _ZN8dmEngine4StepEPNS_6EngineE + 980
ERROR:CRASH: 9 dmengine 0x000000010224a974 _Z14dmEngineUpdatePN8dmEngine6EngineE + 32
ERROR:CRASH: 10 dmengine 0x000000010224b54c _ZN8dmEngine7RunLoopEPKNS_13RunLoopParamsE + 104
ERROR:CRASH: 11 dmengine 0x000000010224b434 _Z11engine_mainiPPc + 88
ERROR:CRASH: 12 dyld 0x000000019f2e20e0 start + 2360
ERROR:CRASH:
**Workaround (OPTIONAL):**
If there is a workaround, please describe it here.
**Screenshots (OPTIONAL):**
If applicable, add screenshots to help explain your problem.
**Additional context (OPTIONAL):**
Add any other context about the problem here.
3 Likes