Skip to content

Conversation

@raphydaphy
Copy link
Member

Made several improvements to lighting and shaders

  • The highest tile for every x position in the world is now tracked (nothing uses this yet but it has many uses)
  • Lighting now penetrates much less into solid blocks, creating a nicer cave ambience (see Lighting #19)
  • The raw world coordinates are now sent to the shaders and translated on the GPU
  • Scaling is now entirely handled by shaders

Also check the API and Assets PR's.

@raphydaphy raphydaphy requested review from Quarris and canitzp August 13, 2019 09:56
@canitzp canitzp changed the title Lighting & Shaders Improvements [Don't merge] Lighting & Shaders Improvements Aug 13, 2019
@raphydaphy raphydaphy changed the title [Don't merge] Lighting & Shaders Improvements Lighting & Shaders Improvements Aug 13, 2019
@raphydaphy raphydaphy self-assigned this Aug 14, 2019
}

@Override
public void draw(float x, float y, float scale) {
Copy link
Member

Choose a reason for hiding this comment

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

Is the scale necessary to have in this method at this point then?


public void render(IGameInstance game, IAssetManager manager, ParticleManager particles, IRenderer g, AbstractWorld world, EntityPlayer player, InteractionManager input) {
float scale = g.getWorldScale();
calcCameraValues(manager, g);
Copy link
Member

Choose a reason for hiding this comment

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

this dot


public float getTranslucentModifier(IWorld world, int x, int y, TileLayer layer, boolean skylight) {
if (world.getState(layer, x, y).get(StaticTileProps.LOG_VARIANT).isNatural())
return skylight ? 1F : layer == TileLayer.BACKGROUND ? 0.9f : 0.8f;
Copy link
Member

Choose a reason for hiding this comment

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

no. separate the conditions

Copy link
Member Author

Choose a reason for hiding this comment

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

u literally watched me type this but ok

Copy link
Member

Choose a reason for hiding this comment

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

yes, and both myself and ellpeck clearly laughed at you and said to change it :P

@Ellpeck
Copy link
Collaborator

Ellpeck commented Feb 4, 2021

merge this, it is good

@Quarris Quarris closed this Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants