tabletop-club
tabletop-club copied to clipboard
[Feature request] Add “fillet” and “chamfer” for cuboids
It would feel more realistic to see rectangles and cubes with fillet. East Asian dice usually have a large fillet, which makes their movement harder to predict.
Can you give an example what exactly you want/mean? Do you have a picture?
In real life, if the corners of cards are right angles, then they will be abraded and utilised for cheating. So they changed it to round corners. It is called “fillet” in CAD and in CSS, it is specified with “border-radius”. The black corners of these cards need to be removed with that “fillet”. https://github.com/MicahBird/tabletop-club-OneCards-asset-pack/blob/main/assets/OneCards/games/One.png
To be fair, this would make objects like cards look nicer.
One potential problem I just thought about, if this was to become a configurable value for objects like cards, then what would happen if cards with different radii stacked on top of each other? Currently the game optimises stacks of cards by essentially representing it as a thicker card, based on the top and bottom cards. Do we only allow cards with the same radii to stack? Or do we just use the top/bottom card's radii?
I'll label this as an enhancement, but this will be somewhat low priority for now, since this is just for looks.
If their radii are different, then they are from different decks, thus not stackable.
For single cards, could this be accomplished with alpha test/alpha clip/cutout? I'm not very familiar with Godot, but maybe this is what Godot calls "alpha scissor"? So, the rounded edge would be determined by the alpha channel in the card texture.
Maybe that doesn't help for stacks, but at least single cards would look nice!
There's multiple different ways this can be achieved I think, here's what I have in mind so far:
- Using transparency in the texture. This is probably the simplest solution, but it comes with a few caveats: rendering engines usually have a hard time rendering transparent objects, especially if there are lots of them in the scene overlapping each other at once. Plus, since cards are represented in-game as really thin cubes, there are still the edges of the cube to worry about if part of the front and back face are transparent.
- Custom meshes with rounded corners. This would avoid needing to have transparency in the texture, and the size of the corner could potentially be configured in the
config.cfgfile, but depending on how many vertices are needed to make the rounded corners look good, it could potentially be unoptimal if there are lots of cards/stacks in the game. - Black magic with shaders. I've dabbled a bit into writing shaders for the game, and from my understanding it could be possible to keep the mesh as a thin cube, but have it transform into one with rounded corners during the rendering pipeline. This would probably be the option that gives the best performance, but I'd have to do some research as to how this could be implemented.