diff options
author | rodri <rgl@antares-labs.eu> | 2024-08-16 13:56:17 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-08-16 13:56:17 +0000 |
commit | 4605adef59010fa2ed74b862e8169baf73680bf4 (patch) | |
tree | 752b7169d4d2f8a9e2f1a54bbd0aa84c1fadb318 | |
parent | f8954cf69e723da397c9ddd3cedf6a2a039668eb (diff) | |
download | 3dee-4605adef59010fa2ed74b862e8169baf73680bf4.tar.gz 3dee-4605adef59010fa2ed74b862e8169baf73680bf4.tar.bz2 3dee-4605adef59010fa2ed74b862e8169baf73680bf4.zip |
let Model.tex have precedence over any material.
-rw-r--r-- | med.c | 18 | ||||
-rw-r--r-- | vis.c | 18 |
2 files changed, 18 insertions, 18 deletions
@@ -280,10 +280,10 @@ gouraudshader(FSparams *sp) { Color tc, c; - if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0) - tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler); - else if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0) + if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0) tc = sampletexture(sp->su->entity->mdl->tex, sp->v.uv, tsampler); + else if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0) + tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler); else tc = Pt3(1,1,1,1); @@ -376,10 +376,10 @@ phongshader(FSparams *sp) specular = mulpt3(lightc, spec*Ks); specular = modulapt3(specular, m.specular); - if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0) - tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler); - else if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0) + if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0) tc = sampletexture(sp->su->entity->mdl->tex, sp->v.uv, tsampler); + else if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0) + tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler); else tc = Pt3(1,1,1,1); @@ -403,10 +403,10 @@ identshader(FSparams *sp) { Color tc, c; - if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0) - tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler); - else if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0) + if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0) tc = sampletexture(sp->su->entity->mdl->tex, sp->v.uv, tsampler); + else if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0) + tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler); else tc = Pt3(1,1,1,1); @@ -165,10 +165,10 @@ gouraudshader(FSparams *sp) { Color tc; - if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0) - tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler); - else if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0) + if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0) tc = sampletexture(sp->su->entity->mdl->tex, sp->v.uv, tsampler); + else if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0) + tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler); else tc = Pt3(1,1,1,1); @@ -262,10 +262,10 @@ phongshader(FSparams *sp) specular = mulpt3(lightc, spec*Ks); specular = modulapt3(specular, m.specular); - if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0) - tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler); - else if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0) + if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0) tc = sampletexture(sp->su->entity->mdl->tex, sp->v.uv, tsampler); + else if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0) + tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler); else tc = Pt3(1,1,1,1); @@ -321,10 +321,10 @@ identshader(FSparams *sp) { Color tc; - if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0) - tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler); - else if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0) + if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0) tc = sampletexture(sp->su->entity->mdl->tex, sp->v.uv, tsampler); + else if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0) + tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler); else tc = Pt3(1,1,1,1); |