1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

sl2:: more projections allowed

This commit is contained in:
Zeno Rogue 2022-10-14 00:54:31 +02:00
parent 7f0bf3b269
commit d218896b63
3 changed files with 16 additions and 1 deletions

View File

@ -744,6 +744,13 @@ EX void apply_other_model(shiftpoint H_orig, hyperpoint& ret, eModel md) {
case mdHorocyclic: { case mdHorocyclic: {
if(sl2) {
ret = unshift(H_orig);
ret *= .5;
ret[LDIM] = 1;
ret = lp_apply(ret);
break;
}
find_zlev(H); find_zlev(H);
apply_nil_rotation(H); apply_nil_rotation(H);

View File

@ -192,7 +192,7 @@ EX namespace models {
if(among(pm, mdBall, mdHemisphere)) return false; if(among(pm, mdBall, mdHemisphere)) return false;
return PIU(model_available(pm)); return PIU(model_available(pm));
} }
if(sl2) return pm == mdGeodesic; if(sl2) return among(pm, mdGeodesic, mdEquidistant, mdHorocyclic, mdPerspective);
if(nonisotropic) return among(pm, mdDisk, mdPerspective, mdHorocyclic, mdGeodesic, mdEquidistant, mdFisheye, mdLiePerspective, mdLieOrthogonal); if(nonisotropic) return among(pm, mdDisk, mdPerspective, mdHorocyclic, mdGeodesic, mdEquidistant, mdFisheye, mdLiePerspective, mdLieOrthogonal);
if(sphere && (pm == mdHalfplane || pm == mdBall)) if(sphere && (pm == mdHalfplane || pm == mdBall))
return false; return false;

View File

@ -349,6 +349,14 @@ shared_ptr<glhr::GLprogram> write_shader(flagtype shader_flags) {
} }
else if(pmodel == mdPerspective) { else if(pmodel == mdPerspective) {
shader_flags |= SF_PERS3 | SF_DIRECT; shader_flags |= SF_PERS3 | SF_DIRECT;
if(sl2) {
vsh += "uniform mediump float uIndexSL;\n";
coordinator +=
"float ca = cos(uIndexSL); float sa = -sin(uIndexSL);\n"
"vec4 h1 = t;\n"
"t[2] = h1[2] * ca - h1[3] * sa; t[3] = 1.;\n"
"t[0] = h1[0] * ca - h1[1] * sa; t[1] = h1[1] * ca + h1[0] * sa;\n";
}
#if CAP_VR #if CAP_VR
if(vrhr::rendering() && hyperbolic && vrhr::eyes != vrhr::eEyes::truesim) { if(vrhr::rendering() && hyperbolic && vrhr::eyes != vrhr::eEyes::truesim) {
azi_hyperbolic = true; azi_hyperbolic = true;