| 182 | } |
| 183 | |
| 184 | void uber_shadow(CBlender_Compile& C, LPCSTR _vspec) |
| 185 | { |
| 186 | // Uber-parse |
| 187 | string256 fname, fnameA, fnameB; |
| 188 | xr_strcpy(fname, *C.L_textures[0]); //. andy if (strext(fname)) *strext(fname)=0; |
| 189 | fix_texture_name(fname); |
| 190 | ref_texture _t; |
| 191 | _t.create(fname); |
| 192 | const bool bump = _t.bump_exist(); |
| 193 | |
| 194 | // detect lmap |
| 195 | bool lmap = true; |
| 196 | if (C.L_textures.size() < 3) |
| 197 | lmap = false; |
| 198 | else |
| 199 | { |
| 200 | const pcstr tex = C.L_textures[2].c_str(); |
| 201 | if (tex[0] == 'l' && tex[1] == 'm' && tex[2] == 'a' && tex[3] == 'p') |
| 202 | lmap = true; |
| 203 | else |
| 204 | lmap = false; |
| 205 | } |
| 206 | |
| 207 | string256 dt; |
| 208 | xr_strcpy(dt, sizeof(dt), C.detail_texture ? C.detail_texture : ""); |
| 209 | |
| 210 | // detect detail bump |
| 211 | string256 texDetailBump = {'\0'}; |
| 212 | string256 texDetailBumpX = {'\0'}; |
| 213 | bool bHasDetailBump = false; |
| 214 | if (C.bDetail_Bump) |
| 215 | { |
| 216 | LPCSTR detail_bump_texture = DEV->m_textures_description.GetBumpName(dt).c_str(); |
| 217 | // Detect and use detail bump |
| 218 | if (detail_bump_texture && strlen(detail_bump_texture)) |
| 219 | { |
| 220 | bHasDetailBump = true; |
| 221 | xr_strcpy(texDetailBump, sizeof(texDetailBump), detail_bump_texture); |
| 222 | xr_strcpy(texDetailBumpX, sizeof(texDetailBumpX), detail_bump_texture); |
| 223 | xr_strcat(texDetailBumpX, "#"); |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | if (!bump) |
| 228 | { |
| 229 | fnameA[0] = fnameB[0] = 0; |
| 230 | } |
| 231 | else |
| 232 | { |
| 233 | xr_strcpy(fnameA, _t.bump_get().c_str()); |
| 234 | strconcat(sizeof(fnameB), fnameB, fnameA, "#"); |
| 235 | } |
| 236 | /* В этом нет смысла |
| 237 | if (bump && RImplementation.o.dx11_enable_tessellation && C.TessMethod != 0) |
| 238 | { |
| 239 | string256 vs; |
| 240 | char hs[256], ds[256]; // = "DX11\\tess", ds[256] = "DX11\\tess"; |
| 241 | char params[256] = "("; |
no test coverage detected