1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-01 10:17:56 +00:00

semidirect rendering

This commit is contained in:
Zeno Rogue
2023-05-15 02:25:13 +02:00
parent 2e1e14c1a2
commit e6738f6c20
3 changed files with 28 additions and 5 deletions

View File

@@ -509,7 +509,15 @@ void addpoly(const shiftmatrix& V, const vector<glvertex> &tab, int ofs, int cnt
}
tofix.clear(); knowgood = false;
if(in_perspective()) {
if(poly_flags & POLY_TRIANGLES) {
if(get_shader_flags() & SF_SEMIDIRECT) {
dynamicval<bool> d(computing_semidirect, true);
for(int i=ofs; i<ofs+cnt; i++) {
hyperpoint Hscr;
applymodel(V * glhr::gltopoint(tab[i]), Hscr);
add1(Hscr);
}
}
else if(poly_flags & POLY_TRIANGLES) {
for(int i=ofs; i<ofs+cnt; i+=3) {
shiftpoint h0 = V * glhr::gltopoint(tab[i]);
shiftpoint h1 = V * glhr::gltopoint(tab[i+1]);