Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lag with perspective and larger cube sizes #9

Open
quantenzitrone opened this issue Sep 13, 2023 · 8 comments
Open

lag with perspective and larger cube sizes #9

quantenzitrone opened this issue Sep 13, 2023 · 8 comments

Comments

@quantenzitrone
Copy link
Contributor

Since I updated retrocube last the command

cube -wi 200 -de 200 -he 200 -sx 0.99 -sy 0.90 -up

doesn't work properly anymore
on commit 76a13dc378c1dd611819e504d9ba6d00f9649754:

2023-09-13.16-09-56.mp4

on current HEAD (95bf2f54ff98813921d34723afb3f467dc912ad3):

2023-09-13.16-10-37.mp4

The cube offset in the videos is just because I recorded my terminal window on the left with obs and somehow obs still recorded in 1920x1080

i also tried to record with asciinema, but it didn't work well

@quantenzitrone
Copy link
Contributor Author

It seems like -up in combination with a large cube like -wi 200 -de 200 -he 200 results in the lag.
The drift seems to happen even with no arguments.

@leonmavr
Copy link
Owner

leonmavr commented Sep 18, 2023

Hey @quantenzitrone,

It's true that the arguments -wi 200 -de 200 -he 200 make it slower. That's because -up activates the perspective transform and combined with large dimensions this makes it map more pixels from 3D to 2D.

For the drift, it happens because I now bounce the cube around the screen to show off that it can move as you can see below:
https://github.com/leonmavr/retrocube/blob/master/main.c#L44
So I should update the README to show it.

I now have some more demos in the demo folder:
https://github.com/leonmavr/retrocube/tree/master/demos

I haven't worked on this project in summer because I was busy with real life but I'll get back to it in about a week. I'll fix demo 6 and then I'm planning to use path tracing instead of ray tracing to reduce the lag (hopefully!).

@quantenzitrone
Copy link
Contributor Author

So is there currently a way to turn off the bouncing?

@leonmavr
Copy link
Owner

No, it's hardcoded at the latest main. You think I should add a toggle or something?

@quantenzitrone quantenzitrone changed the title lag and cube drift lag perspective and larger cube sizes Sep 18, 2023
@quantenzitrone quantenzitrone changed the title lag perspective and larger cube sizes lag with perspective and larger cube sizes Sep 18, 2023
@quantenzitrone
Copy link
Contributor Author

yes

@leonmavr
Copy link
Owner

The latest master now includes a toggle to enable drift (-b N, where N is non-zero number of frames) and some options to define the motion. Drift is off my default. I also updated the README.

@quantenzitrone
Copy link
Contributor Author

beautiful, thank you
the new implementation of perspective still lags very much for larger cube sizes, so i'll keep this open

@leonmavr
Copy link
Owner

Yeah, we can keep it open till I implement the new algorithm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants