TheOpenSpaceProgram / new-ospgl

A space exploration game in OpenGL. Devblog: https://tatjam.github.io/index.html
MIT License
43 stars 6 forks source link

Improved planet renderer drawing order #47

Closed Venuskan closed 1 year ago

Venuskan commented 1 year ago

The tiles nearest to the player get drawn first, after the ocean

tatjam commented 1 year ago

Hey! Thank you for your collaboration!

I've checked the code for ocean sorting and there are two small issues in the implementation:

Once I get home I will check the position code, as I don't quite remember how was tile positioning handled :thinking:

(BTW: If you have trouble running the game once compiled, the assets may be really outdated. I have uploaded new ones to the Releases/ folder so that the game can run).

Venuskan commented 1 year ago

There you go.

tatjam commented 1 year ago

I've modified the code slightly and it should compile now. Right now due to the modifications to scene code it's not possible to get a planet to render, but this is a small change to a lua file as the vehicle spawns in the middle of space.

I'll check if the ordering is correct and it should be ready to merge :)

tatjam commented 1 year ago

Testing around with renderdoc on a simple scene the amount of overdraw is not tremendous (specially looking straight down), but this does reduce it pretty much to zero. Ocean drawing first still needs to implement the check to see if the camera is above the sea, and then switch around the draw order for water and ground, but for now i'll merge this PR.

tatjam commented 1 year ago

Oops I accidentally pushed some code to your fork instead of to the main repo! Sorry for that.