OGSR / OGSR-Engine

OGSR Project - Evolution of X-Ray Engine for S.T.A.L.K.E.R.: Shadow of Chernobyl
https://discord.gg/Q6QDxbNcfR
Other
481 stars 87 forks source link

shaders.xr isn't present. #109

Closed LVutner closed 5 years ago

LVutner commented 5 years ago

Hello. I wanted to ask about adding 3D Scopes to model. I did a one sample model, and added models_lense shader to model with notepad++ but where's shaders.xr? I want to do it with SDK. Thanks.

joye-ramone commented 5 years ago

Hi @MonoLityczny I am not exact sure about SDK, but you can use ogf data changer tool to assign any shander to any mesh on model. Also, models_lense_scope is not a part of shaders.xr. It is lua based shander. You can grab it from OGSE Resources repo: https://github.com/OGSR/OGSR-Engine/tree/main/Game/Resources_SoC_1.0006/gamedata/shaders/r2/models_lense_scope.ps https://github.com/OGSR/OGSR-Engine/tree/main/Game/Resources_SoC_1.0006/gamedata/shaders/r2/models_lense_scope.s

LVutner commented 5 years ago

Can you show me that OGF Data Changer? I cannot find it.

joye-ramone commented 5 years ago

Use this https://drive.google.com/open?id=1LSmq0LBzqWkPsrKznFzxFCnF-N7kgwoU

romanpopulik commented 5 years ago

Hi. It still doesnt work. I was able to change shader name even with notapad++ (glass_stalker_refl has the same number of characters) but on loading screen the game crashes with log:

[error]Expression : FATAL ERROR [error]Function : CResourceManager::_GetBlender [error]File : c:\projects\ogsr-engine\ogsr_engine\xr_3da\resourcemanager.cpp [error]Line : 46 [error]Description : Shader 'models\models_lense_scope' not found in library.

I am using the newest version of ogsr engine with models_lense_scope shaders files included in gamedata\shaders\r2

joye-ramone commented 5 years ago

Did you clean shader cache after you add models_lense_scope ?

romanpopulik commented 5 years ago

I've just tried. I deleted all files in Documents\Stalker-SHOC\logs\shader_cache folder, but it doesnt help, still the same error. Also, models_lense_scope didnt appear in shader_cache folder.

joye-ramone commented 5 years ago

Then you add it in a wrong way. I use all shaders from ogse-resources and all works good - I see compiled models_lense_scope.ps and models can use it

romanpopulik commented 5 years ago

Where do you see compiled models_lense_scope.ps ? In shaders chache ? NVM - I uneccesarily added models/ in shader path while it should be only models_lense_scope Thanks anyway.

romanpopulik commented 5 years ago

Another issue - looks like horizontal rotation is mirrored in scope view: https://youtu.be/g9n-E7t3eJ0

joye-ramone commented 5 years ago

You need to rotate lense meshe to fix this.

romanpopulik commented 5 years ago

It helped, thanks :-)

joye-ramone commented 5 years ago

@romanpopulik So all good now? Can I close this issue?

romanpopulik commented 5 years ago

Just last thing. What is the relation between scope_zoom_factor and scope_lense_fov_factor ? I mean, in example, when I set scope_zoom_factor to value with no zoom at all (it's 90 with hud_fov 50) which value should I use for scope_lense_fov_factor to get 4x zoom ?

romanpopulik commented 5 years ago

Btw - great job with this feature. I finished SVD and it works like a charm.

joye-ramone commented 5 years ago

There is not correlation between scope_lense_fov_factor and scope_zoom_factor But, scope_lense_fov_factor depend on actual user fov and sometimes it requer some testing to find correct value. Also, it is good idea to use scope_inertion_factor with scope_lense_fov_factor to limit mouse speed when use lense.

romanpopulik commented 5 years ago

Ah, I see. Thanks for the info. If you I could help with anything, I'll gladly do this.