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 1 commit into
base: master
Choose a base branch
from

Conversation

HexapodPhilosopher
Copy link
Contributor

Brief Description of What This PR Does

Adds new membrane textures, making different cell types more visually distinct.
Adds new, unique normals for the membrane types.
Changes shader to combine the unique and shared membrane normals.

  • Currently only includes cellulose and silica membranes.
  • Could use some shader adjustments to make the shared normal map move separately from the unique ones.

Related Issues

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.

compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Copy link
Member

Choose a reason for hiding this comment

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

3D textures should have mipmaps enabled for them, even though this is less critical than for 2D GUI images, I think it is still required ot make sure the texture looks good at small sizes (for example when viewing from far away).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay. I was trying to get these to match the pre-existing ones, which had mipmaps disabled.

Copy link
Member

Choose a reason for hiding this comment

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

The diff view it shows this PR also disables mipmaps for many existing textures... so if you looked at those for an example after they were changed that's were you would have gotten the incorrect picture.

Comment on lines +71 to +72
vec3 a = normalmap1*2.0 - 1.0;
vec3 b = normalmap2*2.0 - 1.0;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
vec3 a = normalmap1*2.0 - 1.0;
vec3 b = normalmap2*2.0 - 1.0;
vec3 a = normalmap1 * 2.0f - 1.0f;
vec3 b = normalmap2 * 2.0f - 1.0f;

Spaces should be used around operators to improve readability. Also shaders should really work with floats so numbers should be written preferrably with the f suffix (though I'm not always in the mood to nitpick about this).

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.

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.

2 participants