Tint room floors with the owning seat's colour - #37
Conversation
One could not tell whose room a square was by looking at it: claimed ground carries its owner's colour, but a room floor looked the same whoever it belonged to, with only incidental hints like the shields on the training hall walls. Now that bridges change hands square by square - and rooms may follow - ownership has to be readable at a glance, per square. Room.frag, the fragment shader behind every room floor material, gains a seatColor uniform and blends the floor texture halfway towards the owner's colour. The stock material never sets the uniform and OpenGL zero-initialises uniforms at link time, so its alpha of zero keeps the tint off there; the per-seat clone RenderManager::colourizeMaterial already builds for claimed tiles sets it, exactly as it does for the claimed-ground cross pattern. Tile::shouldColorTileMesh() now lists the room visuals so those clones get made, and colourizeMaterial checks that a material's fragment program actually takes a seatColor before setting it, so a floor material that has not been taught the tint renders untinted instead of raising an exception. Treasury - also the dungeon temple's floor - was the one floor still on the fixed-function RTSS path with no shader to put a tint in, so it moves onto the shared Room shaders like every other room floor. Verified on a two-keeper level: in the editor, seat 1's temple and treasury floors shade red where seat 2's shade green; in a skirmish the local keeper's floors carry their colour under normal lighting and fog, with no material errors in the log. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014hrk8PiEUMgjYJnTxLF2PU
|
I will merge this PR only if I have no results of my own. The problem such tainting looks cheap and makes the whole texture look dirty. What I am aiming at is to have several white elements in the room , which would be coloured by the players/seats color. Exactly as in the case of training room, where you have those white shields and later on they become red , green or blue or other seat's colour. |
I can feed this report to Claude. If you want, you can also give me a longer description of what the game should look like or behave... I can just copy-paste it to Claude and see what gets implemented. |
|
Fair enough — the whole-floor tint is gone. #45 does it the way you describe: white elements in a mask texture that the shader multiplies by the seat colour, exactly the The elements themselves are just PNGs ( I'll leave this one open for you to close in favour of #45, or close it myself if you prefer. |
Addresses the concern raised on #35: "one cannot visually estimate which room belongs to whom when playing game". This makes room ownership readable at a glance, per square — which matters already today (enemy rooms seen through vision all look alike) and becomes essential if rooms ever change hands square by square.
How: the engine already has the machinery — claimed ground gets a per-seat material clone whose
seatColoruniform tints the cross pattern. This PR extends it to room floors:Room.frag(the shader behind every room floor material) gains aseatColoruniform and blends the floor texture halfway towards the owner's colour. The stock material never sets it — OpenGL zero-initialises uniforms at link time, so alpha 0 keeps the tint off — while the per-seat clone fromcolourizeMaterialsets it, exactly like the claimed-ground path.Tile::shouldColorTileMesh()now lists the room visuals so those clones get made for room floors.colourizeMaterialchecks that a material's fragment program actually takes aseatColorbefore setting it, so any floor material that hasn't been taught the tint renders untinted instead of raising an Ogre exception.Treasury.material(also the dungeon temple's floor) was the one floor still on the fixed-function RTSS path with nowhere to put a tint — it moves onto the sharedRoom.vert/Room.fraglike every other room floor.Verified on the two-keeper ForgottenTreasures2 level (the one from #34): in the editor, seat 1's temple + treasury floors shade red where seat 2's shade green; in a skirmish the local keeper's floors carry their colour under normal lighting and fog, and the log shows no material errors.
The 0.5 blend weight is one knob to taste — lower keeps more of the original texture, higher shouts the owner louder. Happy to tune it (or switch to the claimed-style cross-pattern overlay instead of a whole-floor tint) if you prefer another look.
🤖 Generated with Claude Code
https://claude.ai/code/session_014hrk8PiEUMgjYJnTxLF2PU