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

Add normal maps #34901

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

notquitehadouken
Copy link
Contributor

@notquitehadouken notquitehadouken commented Feb 5, 2025

About the PR

Requires Engine PR

You can PR to 25-02-05-bumps on my repo if you want to add bump map (or normal map) sprites, which will speed this up significantly because There's A Lot Of Stuff & Things. Most of them are covered by the normal generator in the engine PR, but some things might need extra spriting (like all the non-main-body species sprites) that I am too inexperienced or time constrained to do. If you do make a PR, comment a link to it here because I will not find it otherwise. I will add you to the CL authors if you do this.

How to add a bump map
  1. Pick a sprite (e.g. protolathe)

If you're just making it shaded flatly (like tables), skip all these steps and go straight to adding it to the RSI:

  1. Create a new image with the same dimensions as the sprite in your preferred image editor (I use paint.net because layers are easy but you do you)
  • Add a completely black background
    • If it helps (and it will), add the regular sprite and draw over it. Remember to remove it after you're done, or else your sprite will look fungly.
  • Draw the bump map COMPLETELY in black and white. White is closer, black is farther.
    • Bump maps are linear. Black is considered the farthest, white is the closest, and 50% is halfway between.
  • Follow generally the same color scheme as the rest of the bump maps I've already made. If you need a reference, use Human/parts.rsi/bump.png.
  • It is not recommended to use pure white for the main body of the sprite, as other parts may be further towards the camera (like the hands on the left and right sprites for people)
  • The bump map is masked to the sprite it's associated with, so you shouldn't add any transparency to it. For sprites typically used in parts (like the lizard tail), make sure the bump map extends slightly beyond the actual sprite if it would be necessary.
    • If you have no idea what I'm talking about, take one of the lizard tail or snout sprites and overlay it with its bump map. Notice how the bump map is bigger than the actual sprite!
  • If your bump map is right up against the edge, note that anything beyond the bounds of the image is considered to be completely black.
    • This includes boundaries between different parts of the image, like species sprites, which have 4 directions. If something was against the edge of one of those 32 x 32 blocks, then anything beyond that block would be considered completely black, even if there was actually something there in the bump map.
  • Put "bump" in the name of the sprite. This isn't required, it just makes it easier to sort.

Once your finish making your bump map, follow these steps to add it to the RSI:

  1. Find the sprite you want to add a bump map to
  • If you just want to make it flatly shaded, add "flatNormal": true, in the state associated with the sprite
  • If you want to make the ENTIRE RSI flatly shaded, add that same text outside of the states (like any of the table RSIs)
  • Bump and normal maps take precedence over flat shading, so if you include flatNormal alongside a bump or normal map, then the flatNormal will be ignored completely.
  1. To add a bump map, go to the state you want to add a bump map to and add "bump": followed by the name of the image in quotes, just like you would do to add a regular sprite with "name":.
  2. To add a normal map, do the same thing, but use the key "normal" instead of the key "bump".
    :trollface:. If you don't know how, I'll add it for you

Need to make bump maps for:

  • Main species body
  • Other parts of species (e.g. lizard tail)
  • Tables & Walls & Windows
  • Puddles
  • Common machines (like the protolathe or chem master)
  • Tools
  • Guns
  • Space suits
  • Backpacks and other similar sprites (see front texture)
  • Various often-used items (by crew and by antags)

Covered by autogenerated normals:

  • Beds
  • Cloaks and bedsheets
  • Department specific items
  • 95% of stuff you wear
  • Inhands
  • ID cards and the EMAG
  • Anything that's less than 5x5 pixels
  • Basically anything living
  • Anything that's mostly flat (like boxes)

Why / Balance

Normal maps are Cool and so is lighting in general

Technical details

Media

image

image

Requirements

Breaking changes

Changelog

🆑

  • add: Added normal maps for lighting! Turn them on in settings (will require restart) to try them out!

@github-actions github-actions bot added size/M Denotes a PR that changes 100-999 lines. Changes: No C# Changes: Requires no C# knowledge to review or fix this item. Changes: Sprites Changes: Might require knowledge of spriting or visual design. S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Feb 5, 2025
Copy link
Contributor

github-actions bot commented Feb 5, 2025

RSI Diff Bot; head commit 1c78a03 merging into 6c7170e
This PR makes changes to 1 or more RSIs. Here is a summary of all changes:

Resources/Textures/Mobs/Customization/reptilian_parts.rsi

State Old New Status
snout_bump_round Added
snout_bump_roundlight Added
snout_bump_sharp Added
snout_bump_sharplight Added
snout_bump_splotch Added
tail_bump_large Added
tail_bump_regular Added
tail_bump_spikes Added

Resources/Textures/Mobs/Species/Arachnid/parts.rsi

State Old New Status
bump Added

Resources/Textures/Mobs/Species/Diona/parts.rsi

State Old New Status
bump Added
bumpf Added

Resources/Textures/Mobs/Species/Gingerbread/parts.rsi

State Old New Status
bump Added

Resources/Textures/Mobs/Species/Human/parts.rsi

State Old New Status
bump Added

Resources/Textures/Mobs/Species/Moth/parts.rsi

State Old New Status
bump Added

Resources/Textures/Mobs/Species/Reptilian/parts.rsi

State Old New Status
bump Added

Resources/Textures/Mobs/Species/Skeleton/parts.rsi

State Old New Status
bump Added
skull_icon_bump Added

Resources/Textures/Mobs/Species/Slime/parts.rsi

State Old New Status
bump Added

Resources/Textures/Mobs/Species/Terminator/parts.rsi

State Old New Status
bump Added
skull_icon_bump Added

Resources/Textures/Mobs/Species/Vox/parts.rsi

State Old New Status
bump Added

Edit: diff updated after 1c78a03

@NoElkaTheGod
Copy link
Contributor

A bit closer to directional lighting

@Kadeo64
Copy link
Contributor

Kadeo64 commented Feb 6, 2025

holy sovl

mind posting some images with moths and lizards? I want to see how this affects tails and wings

@notquitehadouken
Copy link
Contributor Author

notquitehadouken commented Feb 6, 2025

holy sovl

mind posting some images with moths and lizards? I want to see how this affects tails and wings

i am working on markings

@Sadie-silly
Copy link
Contributor

please give us a showcase with the blue and pink bisexual lighting

@notquitehadouken
Copy link
Contributor Author

please give us a showcase with the blue and pink bisexual lighting

later

@Everturning
Copy link

ss a non-coder could i get an explanation as to what normal maps are?

@robinthedragon
Copy link

ss a non-coder could i get an explanation as to what normal maps are?

they tell the computer what direction parts of a sprite are facing. so you could mark pixels as the front of your sprite, and if there's a light infront of the sprite, those pixels will be illuminated. however, if there's a light behind your sprite, they won't be

@notquitehadouken
Copy link
Contributor Author

ss a non-coder could i get an explanation as to what normal maps are?

it's like if the people were 3d but in 2d

@Everturning
Copy link

ss a non-coder could i get an explanation as to what normal maps are?

they tell the computer what direction parts of a sprite are facing. so you could mark pixels as the front of your sprite, and if there's a light infront of the sprite, those pixels will be illuminated. however, if there's a light behind your sprite, they won't be

thank you, this is good 👍

@FairlySadPanda
Copy link
Contributor

ss a non-coder could i get an explanation as to what normal maps are?

they tell the computer what direction parts of a sprite are facing. so you could mark pixels as the front of your sprite, and if there's a light infront of the sprite, those pixels will be illuminated. however, if there's a light behind your sprite, they won't be

thank you, this is good 👍

There's more to it than that ofc so you can read an explainer like this https://www.artstation.com/blogs/typhen/GMyG/this-is-normal-1-what-normal-maps-are-and-how-they-work

TLDR tho it means certain materials can get really sloggers lighting effects... especially if we get specular maps some time :godo:

@TheShuEd TheShuEd added P1: High Priority: Higher priority than other items, but isn't an emergency. T: New Feature Type: New feature or content, or extending existing content Fun: Holy Shit HOLY SHIT! A: Art Area: Art with no implications for other areas. A: Core Tech Area: Underlying core tech for the game and the Github repository. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Feb 10, 2025
@TheShuEd TheShuEd added T: Visual Change Type: Deals with changes to art, sprites or other visuals in the game. D0: Very High Difficulty: Codebase knowledge required is extreme. Consider atomizing instead. labels Feb 10, 2025
@FairlySadPanda
Copy link
Contributor

Aggressively stupid question:

The PR's called "Add normal maps" but the actual added sprites are bump maps? Is the logic here that as a 2D game they are equivalent?

@notquitehadouken
Copy link
Contributor Author

notquitehadouken commented Feb 10, 2025

Aggressively stupid question:

The PR's called "Add normal maps" but the actual added sprites are bump maps? Is the logic here that as a 2D game they are equivalent?

named after the engine PR
also the bump maps are converted to normal maps (see RSILoading.cs ConvertBumpToNormal and its usages)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: Art Area: Art with no implications for other areas. A: Core Tech Area: Underlying core tech for the game and the Github repository. Changes: No C# Changes: Requires no C# knowledge to review or fix this item. Changes: Sprites Changes: Might require knowledge of spriting or visual design. D0: Very High Difficulty: Codebase knowledge required is extreme. Consider atomizing instead. Fun: Holy Shit HOLY SHIT! P1: High Priority: Higher priority than other items, but isn't an emergency. size/M Denotes a PR that changes 100-999 lines. T: New Feature Type: New feature or content, or extending existing content T: Visual Change Type: Deals with changes to art, sprites or other visuals in the game.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants