-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
3D vision for isometric tilesets #66383
Conversation
memorized tile gets drawn on the wrong z-level
Can't wait for it! |
From the screenshots it doesn't render the wall tiles on the layer below, would it be possible to modify it slightly to render the walls beneath ledges as well? |
That is due to "occlusion culling", one of the reasons why we could pull off 3D vision with minimum performance loss. The code is meant for the usual top-down perspective of most tilesets and hence is pretty basic. We could improve it if someone comes up with a specialized algorithm to determine what should be drawn from an isometric perspective. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking very nice!
I think it can be achieved by making the unseen tile sprite have height if it connects to a wall or unseen tile above (so the unseen walls and multi-zlevel unseen regions look like vertical shadow instead of horizontal shadow shown in the screenshot). I also notice the fog sprites have ragged edges, is that due to the overlay rendering function rendering open air tiles as rectangles rather than rhombuses? |
This PR (right above this comment) will help with the fog. |
We can draw tiles that below current level if it touches any one of eight neighboring visible/remembered tiles. But i'm not a programmer, so it's just a guess. |
Yup. Personally, I like how it gives fog a bit of volume especially with the smaller tiles of SmashButton, but the jaggedness is more pronounced in Ultica.
Thanks, looks good to me.
That would be performance unfriendly I'm afraid. Other than fog, what we usually draw are a single z-level's worth of layers. Drawing an additional level underneath could double draw time. We would still have the same problem on buildings taller than 2 levels too. |
measured from t_wall sprite
are the fog sprites for open air trimmed to match the grid pattern of the tile? it looks like theyre just normal square sprites which creates the overlapping and jagged effect when aligned to an iso grid. Edit: nevermind I noticed Vetal already fixed that for you in his pull request, regarding the accidental volumetric effect you can assign specific sprites for ledges which could be used to do a similar effect more intentionally and cleanly |
Co-Authored-By: Jianxiang Wang (王健翔) <[email protected]>
|
Not sure if I should include the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-requesting reviews from non-collaborators: @jbytheway @int-ua
ahhh I was wondering about this. was my only curiousity in testing. |
Yeah, I guess I should put a disclaimer on the original post. |
Don't worry about it, I should have read the conversations before testing. Either way, it's in now 😄 |
Summary
Features "3D vision for isometric tilesets"
Purpose of change
In #65738, 3D vision was disabled for isometric tilesets because of several visual bugs, mostly involving height_3d.
Describe the solution
Update: This PR has been merged but the feature will not be fully functional until I-am-Erk/CDDA-Tilesets#2036 is merged as well and the next tileset update takes place.
This fixes said issues and enables 3D vision for all tilesets. The height_3d feature should now be fully compatible with 3D vision. The apparent height of each z-level can be tweaked by changing the
zlevel_height
property in the tile_info.json / tile_config.json of the target tileset. Cross z-level map memory still does not work properly so I have disabled it for now. That will be worked on next.Describe alternatives you've considered
Testing
Builds ok.
Tested with various scenarios involving different elevations using both HitButton_iso and Ultica_iso tilesets. Renders fine so far.
Map memory for the same z-level works as expected.
Updated compose.py built new tilesets successfully.
Additional context