Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds texture rotation functionality to line renderers and trail renderers, allowing developers to rotate textures around the UV center to correct misaligned seamless textures or adjust fiber patterns.
Changes:
- Added
Rotationproperty toTrailTextureConfigfor specifying texture rotation in degrees - Implemented UV rotation logic in the line shader to apply rotation around the center point
- Connected the rotation property from C# components to the shader via attributes
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| game/addons/base/Assets/shaders/line.shader | Implements UV rotation transformation in the pixel shader using standard 2D rotation matrix |
| engine/Sandbox.Engine/Systems/SceneSystem/SceneTrailObject.cs | Adds Rotation property to TrailTextureConfig and passes it to shader attributes |
| engine/Sandbox.Engine/Scene/Components/Render/LineRenderer.cs | Sets TextureRotation attribute from Texturing.Rotation property |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Separated pull request from #190
Add Rotation to LineRenderer's
TrailTextureConfig. When changing texture scale or rope radius the fibers "rotate" from their normal 45° pattern if you didn't scale with the correct ratio in mind, or if you got a seamless rope texture from the internet most of the time it would be rotated the wrong way. This lets you rotate the texture.Video of the changes in action:
https://files.smallfi.sh/ubre/a2de85f/rope.mp4