mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

Shaders not working properly when model cache is disabled

Open Xenius97 opened this issue 11 months ago • 5 comments

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

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

Xenius97 avatar Aug 28 '23 10:08 Xenius97

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

Xenius97 avatar Aug 28 '23 10:08 Xenius97

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).

Pirulax avatar Aug 28 '23 14:08 Pirulax

if the shader was applied directly to the vehicle

same result when you apply directly to the vehicle

Xenius97 avatar Aug 28 '23 14:08 Xenius97

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

Pirulax avatar Aug 28 '23 22:08 Pirulax

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.

Xenius97 avatar Aug 29 '23 08:08 Xenius97