mirror of
https://github.com/GTAmodding/re3.git
synced 2021-02-19 17:49:54 +01:00
dont render untextured world
This commit is contained in:
parent
0ee87d7b46
commit
453405f131
@ -733,6 +733,9 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
|
|||||||
for(rw::uint32 i = 0; i < building->instHeader->numMeshes; i++, inst++){
|
for(rw::uint32 i = 0; i < building->instHeader->numMeshes; i++, inst++){
|
||||||
Material *m = inst->material;
|
Material *m = inst->material;
|
||||||
|
|
||||||
|
if(m->texture == nil)
|
||||||
|
continue;
|
||||||
|
|
||||||
if(inst->vertexAlpha || m->color.alpha != 255 ||
|
if(inst->vertexAlpha || m->color.alpha != 255 ||
|
||||||
IsTextureTransparent(m->texture)){
|
IsTextureTransparent(m->texture)){
|
||||||
defer = true;
|
defer = true;
|
||||||
@ -769,10 +772,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
|
|||||||
colorscale[0] = colorscale[1] = colorscale[2] = cs;
|
colorscale[0] = colorscale[1] = colorscale[2] = cs;
|
||||||
d3ddevice->SetPixelShaderConstantF(CustomPipes::PSLOC_colorscale, colorscale, 1);
|
d3ddevice->SetPixelShaderConstantF(CustomPipes::PSLOC_colorscale, colorscale, 1);
|
||||||
|
|
||||||
if(m->texture)
|
d3d::setTexture(0, m->texture);
|
||||||
d3d::setTexture(0, m->texture);
|
|
||||||
else
|
|
||||||
d3d::setTexture(0, gpWhiteTexture); // actually we don't even render this
|
|
||||||
|
|
||||||
setMaterial(m->color, m->surfaceProps, 0.5f);
|
setMaterial(m->color, m->surfaceProps, 0.5f);
|
||||||
|
|
||||||
@ -836,19 +836,18 @@ RenderBlendPass(int pass)
|
|||||||
InstanceData *inst = building->instHeader->inst;
|
InstanceData *inst = building->instHeader->inst;
|
||||||
for(rw::uint32 j = 0; j < building->instHeader->numMeshes; j++, inst++){
|
for(rw::uint32 j = 0; j < building->instHeader->numMeshes; j++, inst++){
|
||||||
Material *m = inst->material;
|
Material *m = inst->material;
|
||||||
|
if(m->texture == nil)
|
||||||
|
continue;
|
||||||
if(!inst->vertexAlpha && m->color.alpha == 255 && !IsTextureTransparent(m->texture) && building->fadeAlpha == 255)
|
if(!inst->vertexAlpha && m->color.alpha == 255 && !IsTextureTransparent(m->texture) && building->fadeAlpha == 255)
|
||||||
continue; // already done this one
|
continue; // already done this one
|
||||||
|
|
||||||
float cs = 1.0f;
|
float cs = 1.0f;
|
||||||
if(m->texture)
|
if(m->texture) // always true
|
||||||
cs = 255/128.0f;
|
cs = 255/128.0f;
|
||||||
colorscale[0] = colorscale[1] = colorscale[2] = cs;
|
colorscale[0] = colorscale[1] = colorscale[2] = cs;
|
||||||
d3ddevice->SetPixelShaderConstantF(CustomPipes::PSLOC_colorscale, colorscale, 1);
|
d3ddevice->SetPixelShaderConstantF(CustomPipes::PSLOC_colorscale, colorscale, 1);
|
||||||
|
|
||||||
if(m->texture)
|
d3d::setTexture(0, m->texture);
|
||||||
d3d::setTexture(0, m->texture);
|
|
||||||
else
|
|
||||||
d3d::setTexture(0, gpWhiteTexture); // actually we don't even render this
|
|
||||||
|
|
||||||
rw::RGBA color = m->color;
|
rw::RGBA color = m->color;
|
||||||
color.alpha = (color.alpha * building->fadeAlpha)/255;
|
color.alpha = (color.alpha * building->fadeAlpha)/255;
|
||||||
|
@ -805,6 +805,9 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
|
|||||||
for(rw::uint32 i = 0; i < building->instHeader->numMeshes; i++, inst++){
|
for(rw::uint32 i = 0; i < building->instHeader->numMeshes; i++, inst++){
|
||||||
Material *m = inst->material;
|
Material *m = inst->material;
|
||||||
|
|
||||||
|
if(m->texture == nil)
|
||||||
|
continue;
|
||||||
|
|
||||||
if(inst->vertexAlpha || m->color.alpha != 255 ||
|
if(inst->vertexAlpha || m->color.alpha != 255 ||
|
||||||
IsTextureTransparent(m->texture)){
|
IsTextureTransparent(m->texture)){
|
||||||
defer = true;
|
defer = true;
|
||||||
@ -913,6 +916,8 @@ RenderBlendPass(int pass)
|
|||||||
InstanceData *inst = building->instHeader->inst;
|
InstanceData *inst = building->instHeader->inst;
|
||||||
for(rw::uint32 j = 0; j < building->instHeader->numMeshes; j++, inst++){
|
for(rw::uint32 j = 0; j < building->instHeader->numMeshes; j++, inst++){
|
||||||
Material *m = inst->material;
|
Material *m = inst->material;
|
||||||
|
if(m->texture == nil)
|
||||||
|
continue;
|
||||||
if(!inst->vertexAlpha && m->color.alpha == 255 && !IsTextureTransparent(m->texture) && building->fadeAlpha == 255)
|
if(!inst->vertexAlpha && m->color.alpha == 255 && !IsTextureTransparent(m->texture) && building->fadeAlpha == 255)
|
||||||
continue; // already done this one
|
continue; // already done this one
|
||||||
|
|
||||||
@ -921,7 +926,7 @@ RenderBlendPass(int pass)
|
|||||||
setMaterial(color, m->surfaceProps, 0.5f);
|
setMaterial(color, m->surfaceProps, 0.5f);
|
||||||
|
|
||||||
float cs = 1.0f;
|
float cs = 1.0f;
|
||||||
if(m->texture)
|
if(m->texture) // always true
|
||||||
cs = 255/128.0f;
|
cs = 255/128.0f;
|
||||||
colorscale[0] = colorscale[1] = colorscale[2] = cs;
|
colorscale[0] = colorscale[1] = colorscale[2] = cs;
|
||||||
glUniform4fv(U(CustomPipes::u_colorscale), 1, colorscale);
|
glUniform4fv(U(CustomPipes::u_colorscale), 1, colorscale);
|
||||||
|
Loading…
Reference in New Issue
Block a user