port R_PointToPseudoAngle for Opengl sector clipping from PrBoom+ #98
Closed
alufolie91 wants to merge 8 commits from
pseudoangle into Saturn-Next
pull from: pseudoangle
merge into: saturn:Saturn-Next
saturn:Saturn-Next
saturn:lugstuff
saturn:shadercrap
saturn:retrySOCK
saturn:dynskins
saturn:remove-lua-udata-lib
saturn:polyholes
saturn:Saturn
saturn:mobjcheck
saturn:waterrefract
saturn:bluaopti3
saturn:lua-no-zzone
saturn:mac-ci-test
saturn:luaprofile
saturn:introsfxshit
saturn:mointerpfix
saturn:maperrors2
saturn:maperrors
saturn:testintermissionfix
saturn:optifindvar
saturn:holeywallcolumns
saturn:Saturn-Testing
saturn:addon-download-info
saturn:hwbspupdate
saturn:bluaopti2
saturn:optimizewadlumps
saturn:netstuff
saturn:bluaopti
saturn:newfpscap
saturn:vidmodestuff
saturn:fixedclamp
saturn:threadstuff
saturn:servaddonsonly
saturn:timestuff
saturn:fixcmake2
saturn:crashissuereports
saturn:mipmaplistopti
saturn:menumodels
saturn:fixceemake
saturn:sdl3
saturn:remove-unused-mobj-interp-vars
saturn:revertsdl
saturn:updatesdl2again
saturn:controllerfixes
saturn:fakeseed
saturn:gammastuff
saturn:fastcmpstuff
saturn:luacvarfixes
saturn:SOCKma
saturn:lua-check-local-addon
saturn:updatemixer
saturn:dsdacol
saturn:transposesoft
saturn:updatelibbacktrace
saturn:deletglseg
saturn:curl-cli-args
saturn:refactorfbo
saturn:servericonpack
saturn:fastfilesearch
saturn:ljtest2
saturn:optional-freeslot-test
saturn:updatemd5
saturn:texhash
saturn:winzlib-ng
saturn:mmenucleanup
saturn:fixgnu23
saturn:unnestmothink
saturn:fixupnet
saturn:fixuphwbsp
saturn:updatewinlibs
saturn:emotes
saturn:softwarecrap
saturn:newmakefiles
saturn:luamusicdef
saturn:votebgstuff
saturn:netshit3
saturn:directionallight
saturn:ljtest
saturn:splitscreendirector
saturn:shaderspriteclip
saturn:refactorportals
saturn:nomobjshadows
saturn:sfc32rand
saturn:nettest2
saturn:nettest1
saturn:neo-kart
saturn:addfilelocal-load-animdefs
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
this should speed up opengl sector clipping a bit
didnt notice any negative side effects or rendering issues at all but gave me a slight performance boost on certain maps that suffer from view distance related performance issue
Note: Software renderer wont use this as it kinda needs more precision/ somewhat exact angles or else itll break
Had no issues from short test, code wise looks good too
@@ -431,0 +470,4 @@double vecy = (double)y - viewy;double epsilon = 1e-9;if (fabs(vecx) < epsilon && fabs(vecy) < epsilon)well im just a little unsure, it used to check if both vec are zero, which the compiler didnt like, but comparing if its smaller than 1e-9 epsilon should be fine?
@@ -431,0 +470,4 @@double vecy = (double)y - viewy;double epsilon = 1e-9;if (fabs(vecx) < epsilon && fabs(vecy) < epsilon)Compiler complains because even though double is pretty precise, it is still not perfect so two numbers that are logically same might give you result that is very close to zero but not equals zero, so "double equals zero" will be false almost always.
Tho here you can just change type from double to INT64 and check if it equals 0 (it will be faster and still correct since both y and viewy are fixed_t, which is integer)Didn't pay attention to this part at first, my badOk i need to always look at full code my bad again ><
@@ -431,0 +470,4 @@double vecy = (double)y - viewy;double epsilon = 1e-9;if (fabs(vecx) < epsilon && fabs(vecy) < epsilon)oki changed it to INT64

@@ -431,0 +470,4 @@double vecy = (double)y - viewy;double epsilon = 1e-9;if (fabs(vecx) < epsilon && fabs(vecy) < epsilon)lmao nvm it broke everything
actually, after profiling some more, this actually seems slower than R_PointToAngle64 it doesent clip things well enough and while the function itself may be faster, it makes the game render alot more things making this optimization useless
(tho didnt compare to R_PointToAngleEX yet)
so im gonna close this
Pull request closed