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

Improve visibility of membrane textures #5699

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

HexapodPhilosopher
Copy link
Contributor

@HexapodPhilosopher HexapodPhilosopher commented Nov 20, 2024

Brief Description of What This PR Does

Adds new membrane textures, making different cell types more visually distinct.

  • Currently includes all membranes except chitin.

Related Issues

#5582

Progress Checklist

Note: before starting this checklist the PR should be marked as non-draft.

  • PR author has checked that this PR works as intended and doesn't
    break existing features:
    https://wiki.revolutionarygamesstudio.com/wiki/Testing_Checklist
    (this is important as to not waste the time of Thrive team
    members reviewing this PR)
  • Initial code review passed (this and further items should not be checked by the PR author)
  • Functionality is confirmed working by another person (see above checklist link)
  • Final code review is passed and code conforms to the
    styleguide.

Before merging all CI jobs should finish on this PR without errors, if
there are automatically detected style issues they should be fixed by
the PR author. Merging must follow our
styleguide.

Copy link
Member

@hhyyrylainen hhyyrylainen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could have fixed the minor style problems myself but I noticed this one major thing I don't understand so I have to ask you to clarify / do some changes on this.

@@ -10,9 +10,10 @@ uniform sampler2D albedoTexture : source_color;
uniform sampler2D damagedTexture : source_color;

uniform sampler2D normalTexture;
uniform sampler2D wiggleNormalTexture;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this called "wiggleNormal"? As far as I can see there isn't a difference between the first normal map and the second in terms of wiggle (both seem to be now affected by it). Is there a typo perhaps or did you just mean to have two normal maps? In the latter case I think the variable needs renaming (and the relevant variables in the membrane C# code).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to have them move separately, although I'm not sure there's a need for it. I'll look at making it move relative to the other normal. The alternative would be reverting most of the shader changes and making the new normals more bumpy.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you didn't mean to break a fix by @dligr the normal bump map is supposed to use UV2 and not just the first UV. So if you redo that change to preserve that, then this would all make sense as the second bump map would be affected by the wiggles and the first one wouldn't be.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've experimented with this, and I just don't see any difference in using the UV2. The shader was scaling the UV2 and applying the normal map on the basis of that. The other effects on the normal were based on the value of the normal map as applied, and it makes no difference if it's UV1 or UV2.
What I've now done is removed the second normal map, replaced the normal map texture with one that includes any extra bumpiness required, and applied it via UV1. The effect is the same whichever channel I use, so I might as well use the same one as the albedo.

Copy link
Member

@dligr dligr Nov 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way UV2 was calculated is actually not scaling, but rather something like a projection from a flat plane. UV1 is different in that it's kind of wrapped around the cell.

You can check the difference on larger cells, where bumps would be more streched, while with UV2 they would repeat.

Copy link
Contributor Author

@HexapodPhilosopher HexapodPhilosopher Dec 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I see your point. I hadn't fully compared larger and smaller cells. I'll have to change it back to split normals.

@hhyyrylainen
Copy link
Member

This PR is waiting for those couple of technical fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

3 participants