Skip to content

Shader does not see model's textures after engineReplaceModel #4346

@rifleh700

Description

@rifleh700

Describe the bug

Shader does not see model's textures after engineReplaceModel. Function engineApplyShaderToWorldTexture stops work for model's textures and also function engineGetVisibleTextureNames stops returning model's textures.

  • U can see bug with 730 ID replacing, but u cannot see it for 620 ID replacing for example (only if this bug is really stable - im not sure)
  • I replace only DFF (without TXD or COL)
  • I use original gta3.img DFF file
  • I replace original model to original model (extracted from gta3.img)

Object creating temporally fixes the bug, and u should create it strongly near localPlayer. But interesting that after resource restarting bug appears again. But u can fix bug again if u change Lua script - just add space in any place. But if u then restart resource bug appears again, then u can add one more space for fixing.... etc.

Sometimes after many restarts bug disappears without script editing. But editing guarantees bug fixing

EngineRestreamWorld does not help
EngineReplaceModel alphaTransparency flag does not help

Steps to reproduce

  1. Start "editor"
  2. Go to Santa Maria Beach
Image
  1. Start resource (unpack zip and use folder) replace_bug_test_shader.zip
  2. Both trees are white - shader works
  3. Restart resource - shader does not work on 730 ID (screenshot)
  4. Open script file rbts_main_client.lua - add space symbol in any place
  5. Restart resource - shader works on both models (both trees are white)
  6. Restart resource - shader does not work on 730 ID
  7. Add space symbol - shader works on both models
  8. ...............

Version

Client: Multi Theft Auto v1.6-release-23318 (Win10 64)
Server: MTA:SA Server v1.6-release-23318 (Win10 64)

Additional context

No response

Relevant log output

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions