Skip to content

Implement Texture Rotation#9911

Open
yuberee wants to merge 2 commits intoFacepunch:masterfrom
yuberee:rope-rotation
Open

Implement Texture Rotation#9911
yuberee wants to merge 2 commits intoFacepunch:masterfrom
yuberee:rope-rotation

Conversation

@yuberee
Copy link
Contributor

@yuberee yuberee commented Jan 27, 2026

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

Copilot AI review requested due to automatic review settings January 27, 2026 22:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Rotation property to TrailTextureConfig for 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.

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.

1 participant