diff options
author | aap <aap@papnet.eu> | 2021-01-12 14:07:24 +0100 |
---|---|---|
committer | aap <aap@papnet.eu> | 2021-01-12 14:07:24 +0100 |
commit | 55320a03f14c473b0fff89585713d2ebd8feb92a (patch) | |
tree | 8f64328d62a3e9586f20e72928dc720db4400fc4 /src/extras | |
parent | mobile vehicle rendering (diff) | |
download | re3-55320a03f14c473b0fff89585713d2ebd8feb92a.tar re3-55320a03f14c473b0fff89585713d2ebd8feb92a.tar.gz re3-55320a03f14c473b0fff89585713d2ebd8feb92a.tar.bz2 re3-55320a03f14c473b0fff89585713d2ebd8feb92a.tar.lz re3-55320a03f14c473b0fff89585713d2ebd8feb92a.tar.xz re3-55320a03f14c473b0fff89585713d2ebd8feb92a.tar.zst re3-55320a03f14c473b0fff89585713d2ebd8feb92a.zip |
Diffstat (limited to 'src/extras')
-rw-r--r-- | src/extras/custompipes.cpp | 2 | ||||
-rw-r--r-- | src/extras/custompipes.h | 2 | ||||
-rw-r--r-- | src/extras/custompipes_d3d9.cpp | 11 | ||||
-rw-r--r-- | src/extras/custompipes_gl.cpp | 11 | ||||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile.vert | 2 | ||||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile_PS.hlsl | 1 | ||||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile_VS.hlsl | 3 | ||||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile_vs_gl.inc | 2 |
8 files changed, 14 insertions, 20 deletions
diff --git a/src/extras/custompipes.cpp b/src/extras/custompipes.cpp index a636f8b0..247aa4b1 100644 --- a/src/extras/custompipes.cpp +++ b/src/extras/custompipes.cpp @@ -46,7 +46,7 @@ CustomMatCopy(void *dst, void *src, int32, int32) rw::TexDictionary *neoTxd; -bool bChromeCheat; +bool gGlassCarsCheat; bool bRenderingEnvMap; int32 EnvMapSize = 512; rw::Camera *EnvMapCam; diff --git a/src/extras/custompipes.h b/src/extras/custompipes.h index 9674a6d1..e83201ff 100644 --- a/src/extras/custompipes.h +++ b/src/extras/custompipes.h @@ -75,7 +75,7 @@ void CustomPipeInit(void); void CustomPipeShutdown(void); void SetTxdFindCallback(void); -extern bool bChromeCheat; +extern bool gGlassCarsCheat; extern bool bRenderingEnvMap; extern int32 EnvMapSize; extern rw::Camera *EnvMapCam; diff --git a/src/extras/custompipes_d3d9.cpp b/src/extras/custompipes_d3d9.cpp index 1dc4c0bb..9a02f874 100644 --- a/src/extras/custompipes_d3d9.cpp +++ b/src/extras/custompipes_d3d9.cpp @@ -114,7 +114,7 @@ leedsVehicleRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) uploadMatrices(atomic->getFrame()->getLTM()); setVertexShader(leedsVehicle_VS); - if(bChromeCheat) + if(gGlassCarsCheat) setPixelShader(leedsVehicle_blend_PS); else setPixelShader(leedsVehicle_add_PS); @@ -131,10 +131,11 @@ leedsVehicleRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header) SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 255); float coef = 0.0f; - if(RpMatFXMaterialGetEffects(m) == rpMATFXEFFECTENVMAP) + if(RpMatFXMaterialGetEffects(m) == rpMATFXEFFECTENVMAP){ coef = CClock::ms_EnvMapTimeMultiplicator * RpMatFXMaterialGetEnvMapCoefficient(m)*0.5f; - if(bChromeCheat && coef > 0.0f) - coef = 1.0f; + if(gGlassCarsCheat) + coef = 1.0f; + } d3ddevice->SetPixelShaderConstantF(PSLOC_shininess, (float*)&coef, 1); setMaterial(m->color, m->surfaceProps); @@ -205,7 +206,7 @@ leedsVehicleRenderCB_mobile(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *he float coef = 0.0f; if(RpMatFXMaterialGetEffects(m) == rpMATFXEFFECTENVMAP){ coef = CClock::ms_EnvMapTimeMultiplicator * RpMatFXMaterialGetEnvMapCoefficient(m)*0.5f; - if(bChromeCheat) + if(gGlassCarsCheat) coef = 1.0f; } d3ddevice->SetPixelShaderConstantF(PSLOC_shininess, (float*)&coef, 1); diff --git a/src/extras/custompipes_gl.cpp b/src/extras/custompipes_gl.cpp index 35a30316..eeb62b8d 100644 --- a/src/extras/custompipes_gl.cpp +++ b/src/extras/custompipes_gl.cpp @@ -122,7 +122,7 @@ leedsVehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) InstanceData *inst = header->inst; rw::int32 n = header->numMeshes; - if(bChromeCheat) + if(gGlassCarsCheat) leedsVehicleShader_blend->use(); else leedsVehicleShader_add->use(); @@ -138,10 +138,11 @@ leedsVehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header) rw::SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF); float coef = 0.0f; - if(RpMatFXMaterialGetEffects(m) == rpMATFXEFFECTENVMAP) + if(RpMatFXMaterialGetEffects(m) == rpMATFXEFFECTENVMAP){ coef = CClock::ms_EnvMapTimeMultiplicator * RpMatFXMaterialGetEnvMapCoefficient(m)*0.5f; - if(bChromeCheat && coef > 0.0f) - coef = 1.0f; + if(gGlassCarsCheat) + coef = 1.0f; + } glUniform1f(U(u_fxparams), coef); setMaterial(m->color, m->surfaceProps); @@ -216,7 +217,7 @@ leedsVehicleRenderCB_mobile(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *hea float coef = 0.0f; if(RpMatFXMaterialGetEffects(m) == rpMATFXEFFECTENVMAP){ coef = CClock::ms_EnvMapTimeMultiplicator * RpMatFXMaterialGetEnvMapCoefficient(m)*0.5f; - if(bChromeCheat) + if(gGlassCarsCheat) coef = 1.0f; } glUniform1f(U(u_fxparams), coef); diff --git a/src/extras/shaders/leedsVehicle_mobile.vert b/src/extras/shaders/leedsVehicle_mobile.vert index e18c2f02..b2123fa4 100644 --- a/src/extras/shaders/leedsVehicle_mobile.vert +++ b/src/extras/shaders/leedsVehicle_mobile.vert @@ -26,11 +26,9 @@ main(void) v_color = in_color; vec4 combinedAmbient = mix(u_emiss, u_amb, Normal.z); -// v_color.rgb += u_ambLight.rgb*surfAmbient; v_color.rgb += combinedAmbient.rgb*surfAmbient; v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse; v_lightingCont = max(0.5, (v_color.r + v_color.g + v_color.b) / 3.0); -// v_color = clamp(v_color, 0.0, 1.0); v_color *= u_matColor; // for fresnel diff --git a/src/extras/shaders/leedsVehicle_mobile_PS.hlsl b/src/extras/shaders/leedsVehicle_mobile_PS.hlsl index e81c66c9..da09b872 100644 --- a/src/extras/shaders/leedsVehicle_mobile_PS.hlsl +++ b/src/extras/shaders/leedsVehicle_mobile_PS.hlsl @@ -45,7 +45,6 @@ float4 main(VS_out input) : COLOR float opacity = lerp(minOpacity, maxOpacity, fresnel)*pass1.a; float4 color = pass1 + float4(reflectivity * envOut, 0.0); -//float4 color = float4(reflectivity, reflectivity, reflectivity, reflectivity); color.a = opacity; color.rgb = lerp(fogColor.rgb, color.rgb, input.TexCoord0.z); diff --git a/src/extras/shaders/leedsVehicle_mobile_VS.hlsl b/src/extras/shaders/leedsVehicle_mobile_VS.hlsl index 667c0963..3085c5e4 100644 --- a/src/extras/shaders/leedsVehicle_mobile_VS.hlsl +++ b/src/extras/shaders/leedsVehicle_mobile_VS.hlsl @@ -38,15 +38,12 @@ VS_out main(in VS_in input) output.Color = input.Prelight; float4 combinedAmbient = lerp(emissive, ambient, N.z); -// output.Color.rgb += ambientLight.rgb * surfAmbient; output.Color.rgb += combinedAmbient.rgb * surfAmbient; int i; for(i = 0; i < numDirLights; i++) output.Color.xyz += DoDirLight(lights[i+firstDirLight], N)*surfDiffuse; lightingCont = max(0.5, (output.Color.r + output.Color.g + output.Color.b) / 3.0); - // PS2 clamps before material color -// output.Color = clamp(output.Color, 0.0, 1.0); output.Color *= matCol; // for fresnel diff --git a/src/extras/shaders/leedsVehicle_mobile_vs_gl.inc b/src/extras/shaders/leedsVehicle_mobile_vs_gl.inc index b1f07563..3609e369 100644 --- a/src/extras/shaders/leedsVehicle_mobile_vs_gl.inc +++ b/src/extras/shaders/leedsVehicle_mobile_vs_gl.inc @@ -27,11 +27,9 @@ const char *leedsVehicle_mobile_vert_src = " v_color = in_color;\n" " vec4 combinedAmbient = mix(u_emiss, u_amb, Normal.z);\n" -"// v_color.rgb += u_ambLight.rgb*surfAmbient;\n" " v_color.rgb += combinedAmbient.rgb*surfAmbient;\n" " v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;\n" " v_lightingCont = max(0.5, (v_color.r + v_color.g + v_color.b) / 3.0);\n" -"// v_color = clamp(v_color, 0.0, 1.0);\n" " v_color *= u_matColor;\n" " // for fresnel\n" |