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

[feat] Bedrock Sun Glare and Sky Color #224

Merged
merged 6 commits into from
Feb 25, 2023

Commits on Feb 9, 2023

  1. [feat] Bedrock Sun Glare and Sky Color

    The feature of Bedrock Sun Glare and Sky Color. This is enabled by the `sunlightIntensity` value and `bedrockShading` option in the Visual Improvements settings.
    
    * new configurable parameters
      - int `BedrockifyClientSettings#sunlightIntensity`: 0 - 100, default 50
    
    * update `lang/en_us.json`
      - edit `bedrockify.options.bedrockShading`
      - add `bedrockify.options.sunlightIntensity`
      - add tooltip texts:
        + `bedrockify.options.bedrockShading.tooltip`
        + `bedrockify.options.sunlightIntensity.tooltip`
    
    * update `BedrockifyClientSettings`
      - add a field `sunlightIntensity`
    
    * update `SettingsGUI`
      - add tooltip for the options:
        + `bedrockShading`
        + `sunlightIntensity`
    
    * registered new mixins
      - `mixin.client.features.bedrockShading.sunGlare.ClientWorldMixin`
        + to modify the Sky color
      - `mixin.client.features.bedrockShading.sunGlare.WorldRendererMixin`
        + to modify the Sun radius
    
    * moved mixins
      - `mixin.client.features.bedrockShading.AbstractQuadRendererMixin` -> `lightBlock.AbstractQuadRendererMixin`
      - `mixin.client.features.bedrockShading.BlockModelRendererMixin` -> `lightBlock.BlockModelRendererMixin`
      - `mixin.client.features.bedrockShading.FluidRendererMixin` -> `lightBlock.FluidRendererMixin`
    
    * new files
      - `client.features.bedrockShading.BedrockSunGlareShading`
        + helper class that calculate angle diff
    lonefelidae16 committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    86cf6d6 View commit details
    Browse the repository at this point in the history
  2. [compat] Shader mods

    Make it compatible with shader mods.
    
    * update `BedrockSunGlareShading`
      - inner classes:
        + enum `ShaderState`: shows the state of custom shader
        + class `ClassMethodHolder`: holds class name, method name, args and predicate
      - fields:
        + ShaderState `shaderState`: to determine the state of custom shader
        + Map `MOD_ID_CLASS_MAP`: uses with Reflection
      - methods:
        + void `reloadCustomShaderState`: notifies changed the shader state
        + boolean `isEnabled` -> `shouldApplyShading`: gets whether can apply this feature
        + ShaderState `fetchShaderStateInternal`: gets the state of custom shader
    
    * update `mixin.client.features.bedrockShading.sunGlare.WorldRendererMixin`
      - new method `bedrockify$reloadWorldRendererCallback`: to reload the state of custom shader
    lonefelidae16 committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    9f6d0ea View commit details
    Browse the repository at this point in the history
  3. [update] add a test case

    Adds a test case to be compatible with Iris shaders using Reflection.
    
    * update dependencies
      - `build.gradle`
        + fabric loom 1.1-SNAPSHOT
        + add a sourceSet of the test
        + add Modrinth's maven repo
        + add Iris, JUnit
      - `gradle.properties`
        + add a property of Iris version
    
    * new files
      - `test.client.features.bedrockShading.sunGlare.IrisCompatTest`
        + > ./gradlew test
    lonefelidae16 committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    36f8377 View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2023

  1. [optimize] calculating the dot product

    Update the sun vector after client tick due to the sun does not move so fast.
    
    Update the dot product only once when executed `WorldRenderer#renderSky`.
    
    * update `BedrockSunGlareShading`
      - fields:
        + float `sunAngleDiff`
        + Vector3f `sunVector3f`
        + MinecraftClient `client`
      - methods:
        + void `tick`
        + void `updateAngleDiff`
        + static float `getSunAngleDiffClamped(float)` -> float `getSunAngleDiff()`
    
    * update `BedrockifyClient`
      - register a new method in `END_CLIENT_TICK`:
        + `BedrockSunGlareShading#tick`
    
    * update `WorldRendererMixin`
      - method name has changed: `bedrockify$storeSunAngleDiff` -> `bedrockify$updateSunAngleDiff`
      - mixin injection point has changed: `HEAD` -> `BEFORE_INVOKE` target = `ClientWorld#getSkyColor`
    lonefelidae16 committed Feb 13, 2023
    Configuration menu
    Copy the full SHA
    3a2da3c View commit details
    Browse the repository at this point in the history
  2. [chore] update some files

    * update `en_us.json`
      - the word "vanilla rendering" might not be user friendly
    
    * update `IrisCompatTest.java`
      - add JavaDoc
      - add affected class info to error message
    
    * update `BedrockSunGlareShading.java`
      - update JavaDoc
      - add new const: ClassMethodHolder `ClassMethodHolder#CONDITION_TRUE`
    
    * update `ClientWorldMixin.java`
      - does not require to extend super class
    lonefelidae16 committed Feb 13, 2023
    Configuration menu
    Copy the full SHA
    9e7c85b View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2023

  1. Configuration menu
    Copy the full SHA
    2de4526 View commit details
    Browse the repository at this point in the history