At lower fovs going from one whole number to the next can be a bit of a jump.
Also would be nice to be able to do extreme zooming with fovs of less than 1.
Make camera actor fov double instead of int
Moderator: GZDoom Developers
Re: Make camera actor fov double instead of int
Question:
I don't know the netcode too well but... is it enough to just change the Net_WriteByte calls in player_t::SetFOV to Net_WriteFloat and changing the respective FOV cases in Net_DoCommand to use ReadFloat(stream)? Will it negatively affect network latency or anything like that?
(Interestingly enough, nothing in the engine utilizes Net_WriteFloat even though it exists...)
I don't know the netcode too well but... is it enough to just change the Net_WriteByte calls in player_t::SetFOV to Net_WriteFloat and changing the respective FOV cases in Net_DoCommand to use ReadFloat(stream)? Will it negatively affect network latency or anything like that?
(Interestingly enough, nothing in the engine utilizes Net_WriteFloat even though it exists...)
Re: Make camera actor fov double instead of int
Okay I did try to change the Net_WriteByte calls to Net_WriteFloat but I keep getting some "unknown net command" errors and get bombed to the console. I am almost certain it's because I'm not handling the DEM_FOV and DEM_MYFOV cases properly in Net_SkipCommand. Problem is, I have zero clue how to determine what the value of "skip" should be. It makes zero sense to me just by reading what the others are doing, and there's no documentation of it anywhere in the source code, nor on the internet. Can anyone give me any clues?
Re: Make camera actor fov double instead of int
The value of skip is a number of bytes left in this message. For one floating point value it's four.
Re: Make camera actor fov double instead of int
Ok thanks _mental_.
Made a PR: https://github.com/coelckers/gzdoom/pull/360/commits
@Vaecrius:
All that was really changed here is using the console to change your FOV now has floating point precision.
A_ZoomFactor, the newly-introduced CameraFOV for non-players, and setting the player's FOV directly, has always allowed you to use floats all along, so I need to ask: what exactly was your intended use case when you made this suggestion?
Made a PR: https://github.com/coelckers/gzdoom/pull/360/commits
@Vaecrius:
All that was really changed here is using the console to change your FOV now has floating point precision.
A_ZoomFactor, the newly-introduced CameraFOV for non-players, and setting the player's FOV directly, has always allowed you to use floats all along, so I need to ask: what exactly was your intended use case when you made this suggestion?
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Make camera actor fov double instead of int
TexMan.SetCameraToTexture() can only take an int.
I've never really paid much attention to anything else so I assumed all the fov functions did too!
EDIT: and now that I try it (3.1.0), it seems that the fov command also only takes integers.
I've never really paid much attention to anything else so I assumed all the fov functions did too!
EDIT: and now that I try it (3.1.0), it seems that the fov command also only takes integers.
Re: Make camera actor fov double instead of int
You should have specifically said this in your original request..Vaecrius wrote:TexMan.SetCameraToTexture() can only take an int.
When in doubt, refer to what type a method takes in inside GZDoom.pk3I've never really paid much attention to anything else so I assumed all the fov functions did too!
Yes, the FOV console command only works with ints. My PR changes that. Now of course, it turns out that what I did was not related at all to what you really asked for. :PEDIT: and now that I try it (3.1.0), it seems that the fov command also only takes integers.
I took a look at SetCameraTexure. It should be do-able but it's not too simple for me to do since the related code is strewn across several files and between the different renderers, and I'm just not confident about tweaking that stuff. It would be great to be given a simple runnable test WAD for me to test my changes... however, to be honest, I don't really dare touch the camera texture code... I'll probably just make things worse. :P Best let Graf do it.
@Devs: feel free to move the floating point FOV CCMD stuff out of this thread if it's cluttering things up in here
Re: Make camera actor fov double instead of int
Changed camera textures to use floating point for FOV. Demo file attached.Vaecrius wrote:TexMan.SetCameraToTexture() can only take an int.
Works OK in OpenGL and software renderers, although in the TC software renderers, I lose 20 FPS... probably all those SetCameraToTexture calls every tick is murderous and can be associated with bad user scripting techniques.
- Attachments
-
- camtextest.zip
- (2.04 KiB) Downloaded 32 times
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Make camera actor fov double instead of int
Just tried the latest GZDoom git and it works as I wanted it to, thanks!