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

Optimized holographic #482

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open

Optimized holographic #482

wants to merge 1 commit into from

Conversation

Braiam23
Copy link
Collaborator

@Braiam23 Braiam23 commented Sep 7, 2024

📝 Description

This PR contains improved textures for the holographic sights, and also improves the models I try to replicate to real-life models. What differentiates it from other PRs is that the non-visible parts of the models do not have textures, making it only focus on the visible parts.

  • Improves the model and texture of the holographic (Black color)
  • Improves the texture and eliminates the z-fighting of the model (Tan color)

🎯 Goals

  • Perform texture optimization tests with small models
  • Improve texture quality (A little closer to the original Vic Modern Warfare style)

❌ Non Goals

Breaking holographic sight textures in-game

🚦 Testing

It works correctly...

⏮️ Backwards Compatibility

Fully compatible with older versions

📚 Related Issues & Documents

N/A

🖼️ Screenshots/Recordings

HolographicBlack

HolographicTan

📖 Added to documentation?

  • 📜 README.md
  • 📑 Documentation
  • 📓 Javadoc
  • 🍕 Comments
  • 🙅 No documentation needed

😄 [optional] What gif best describes this PR or how it makes you feel?

N/A

By the way, if you have no idea what to do with the mod, let the designers' work revive the mod or let me manage the project for a few days XD.

Now if you don't accept the PR I don't know how I can help you with the mod either.

Copy link
Contributor

coderabbitai bot commented Sep 7, 2024

Walkthrough

Walkthrough

The pull request introduces significant structural changes to the Holographic and Holographic2 classes in the Minecraft modding framework. In the Holographic class, multiple ModelRenderer components have been renamed and reorganized, with new instances added to enhance clarity. The constructor's texture dimensions have been adjusted from 100 to 80, and the geometry of the model has been refined through modifications to cube definitions. The rendering logic remains unchanged despite these structural updates.

In the Holographic2 class, a complete overhaul has been performed, consolidating the model's components into a single ModelRenderer instance named holo. This change simplifies the constructor, reducing the texture dimensions from 256x128 to 64x64, and replaces individual ModelRenderer fields with a more cohesive approach using ModelBox additions. The setRotation method has been renamed to setRotationAngle, reflecting a change in naming convention. Overall, these modifications indicate a shift towards a more organized and efficient model rendering process.

Changes

Files Change Summary
src/main/java/com/paneedah/mwc/models/Holographic.java Significant restructuring of ModelRenderer components, renaming, and adjustments to texture dimensions and geometry.
src/main/java/com/paneedah/mwc/models/Holographic2.java Complete overhaul of model structure, consolidating components into a single ModelRenderer, with simplified constructor and rendering logic.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Holographic
    participant Holographic2

    User->>Holographic: Initialize Holographic Model
    Holographic->>Holographic: Set texture dimensions
    Holographic->>Holographic: Define cube geometry
    Holographic->>User: Render Model

    User->>Holographic2: Initialize Holographic2 Model
    Holographic2->>Holographic2: Set texture dimensions
    Holographic2->>Holographic2: Define geometry using ModelBox
    Holographic2->>User: Render Model
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f0e7e02 and 0043201.

Files ignored due to path filters (2)
  • src/main/resources/assets/mwc/textures/models/holographic.png is excluded by !**/*.png, !**/*.png
  • src/main/resources/assets/mwc/textures/models/holographic2.png is excluded by !**/*.png, !**/*.png
Files selected for processing (2)
  • src/main/java/com/paneedah/mwc/models/Holographic.java (1 hunks)
  • src/main/java/com/paneedah/mwc/models/Holographic2.java (1 hunks)
Additional comments not posted (2)
src/main/java/com/paneedah/mwc/models/Holographic2.java (1)

50-352: Comprehensive Refactoring of Holographic2 Class

The Holographic2 class has undergone a significant refactoring, introducing a more streamlined and maintainable structure. The introduction of a single ModelRenderer instance named holo which encapsulates all components is a positive change, enhancing the organization and potentially improving rendering performance.

Key Observations:

  • Texture Dimensions: The change from 256x128 to 64x64 is notable. While this reduction could potentially decrease the texture quality, it may also be part of an optimization strategy to improve performance. It's crucial to ensure that this change aligns with the PR's goals of enhancing texture quality.
  • ModelRenderer Additions: Each new ModelRenderer instance added as a child to holo is well-defined with specific rotation points and cube additions. This hierarchical model organization facilitates easier modifications and debugging.
  • Method Renaming: The renaming of setRotation to setRotationAngle improves readability and conforms to Java naming conventions.

Recommendations:

  • Verify Texture Quality: Ensure that the reduced texture dimensions do not adversely affect the visual quality, especially given the PR's focus on texture enhancements.
  • Optimization Checks: Conduct performance tests to verify that the new model structure and reduced texture dimensions contribute positively to rendering efficiency.
  • Documentation: Update any developer documentation to reflect these structural changes and provide guidelines on how to modify or extend the Holographic2 model effectively.

Overall, the changes are well-executed and align with best practices for maintainability and performance optimization. However, careful attention should be paid to the impact of texture dimension changes on the final rendered product.

src/main/java/com/paneedah/mwc/models/Holographic.java (1)

52-338: Comprehensive Refactoring of Holographic Class

The Holographic class has undergone a significant refactoring, introducing a more streamlined and maintainable structure. The introduction of new ModelRenderer instances with updated naming conventions is a positive change, enhancing the organization and potentially improving rendering performance.

Key Observations:

  • Texture Dimensions: The change from 100 to 80 is notable. While this reduction could potentially decrease the texture quality, it may also be part of an optimization strategy to improve performance. It's crucial to ensure that this change aligns with the PR's goals of enhancing texture quality.
  • ModelRenderer Additions: Each new ModelRenderer instance added is well-defined with specific rotation points and cube additions. This hierarchical model organization facilitates easier modifications and debugging.
  • Method Retention: The retention of the setRotationAngle method with its original functionality ensures that existing customizations and extensions to the model will continue to function without modification.

Recommendations:

  • Verify Texture Quality: Ensure that the reduced texture dimensions do not adversely affect the visual quality, especially given the PR's focus on texture enhancements.
  • Optimization Checks: Conduct performance tests to verify that the new model structure and reduced texture dimensions contribute positively to rendering efficiency.
  • Documentation: Update any developer documentation to reflect these structural changes and provide guidelines on how to modify or extend the Holographic model effectively.

Overall, the changes are well-executed and align with best practices for maintainability and performance optimization. However, careful attention should be paid to the impact of texture dimension changes on the final rendered product.

@Braiam23
Copy link
Collaborator Author

Braiam23 commented Sep 7, 2024

By the way, I will not put this change in the Changelog because it is not fundamental, it does not drastically change the mod, it is just a small improvement.

@Desoroxxx
Copy link
Collaborator

By the way, if you have no idea what to do with the mod, let the designers' work revive the mod or let me manage the project for a few days XD.

Now if you don't accept the PR I don't know how I can help you with the mod either.

You are already lead designer

By the way, I will not put this change in the Changelog because it is not fundamental, it does not drastically change the mod, it is just a small improvement.

Changelog is here to log changes, no matter how small it may be, anyway I will do it myself I guess.

Thanks for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants