multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.38k stars 425 forks source link

Shaders not working properly when model cache is disabled #3164

Open Xenius97 opened 1 year ago

Xenius97 commented 1 year ago

Describe the bug

Shaders wont work properly if model cache is disabled, eg: custom paintjobs no longer rendering if model is unloaded from cache. https://streamable.com/honyzg -> from 1:28

Steps to reproduce

Load custom vehicle model Add paintjob Use engineStreamingSetModelCacheLimits (engineStreamingSetModelCacheLimits(0, 0)) Go in interior or spawn vehicle

Resources used in video: resources.zip

Version

Multi Theft Auto v1.6-release-22184

Additional context

No response

Relevant log output

No response

Security Policy

Xenius97 commented 1 year ago

engineRestreamWorld only will fix this issue if you're not sitting in vehicle

edit: seems like engineStreamingSetModelCacheLimits(1, 1) has solved this issue for temporary

Pirulax commented 1 year ago

engineStreamingSetModelCacheLimits(1, 1)

Probably solves the issue because that one vehicle stays in the cache.

I wonder if the same issue would occur if the shader was applied directly to the vehicle? As in engineApplyShaderToWorldTexture(shader, "*remap*", vehicle).

Xenius97 commented 1 year ago

if the shader was applied directly to the vehicle

same result when you apply directly to the vehicle

Pirulax commented 1 year ago

okay I see. that doesn't seem right. what if you manually re-apply the shader in onClientElementStreamIn?

Xenius97 commented 1 year ago

okay I see. that doesn't seem right. what if you manually re-apply the shader in onClientElementStreamIn?

Shader and textures are created but not rendering on vehicle until restream everything.