A high-performance skybox blending shader for Unity, featuring directional cubemap transitions, procedural dissolve, and HDR glow edge effects. Designed for cinematic environment shifts and seamless world transitions. Supports global control via _WorldFading and is optimized for runtime performance with branchless masking.
👉 ภาษาไทยอยู่ข้างล่าง 👇 จิ้ม
🧩 Compatible with Unity 2022.3 or newer
You can import this package directly from the Unity Editor:
- Open Unity and go to
Window > Package Manager - Click the
+button (top-left), then selectAdd package from git URL... - Paste in the following URL:
https://github.com/menstood/worldfading.git
- Click Add — Unity will automatically fetch and install the package 🎉
- Go to
Assets > Create > Material - Set the Shader to
Menstood/BlendTwoCubemapsWithGlowEdge - Assign cubemaps:
_CubemapA: Your starting skybox_CubemapB: The one you want to transition into
- Go to
Window > Rendering > Lighting - In the Environment section, assign the material to Skybox Material
- Add the script
WorldFading.csto any GameObject in your scene
-
For automatic tweening:
CallPlay()in your script -
For manual control:
Shader.SetGlobalFloat("_WorldFading", 0.5f); // 0 = A, 1 = B👉 Follow me at facebook.com/thisisunityth
🧩 รองรับ Unity เวอร์ชัน 2022.3 ขึ้นไป
Shader สำหรับเปลี่ยน skybox แบบเท่ ๆ ใช้ได้กับ Unity โดยตรง
Blend ระหว่างสอง cubemap ตามมุมกล้อง + ใส่ dissolve ได้แบบ procedural และมีขอบ glow แบบ HDR
เหมาะกับใช้ตอนเปลี่ยนโลก เปลี่ยนมิติ หรือทำ transition แบบ cinematic
ควบคุมด้วย _WorldFading แค่ตัวเดียว ใช้ง่าย
ทั้งหมด optimize มาให้รันโคตรลื่น ไม่มี if ใน fragment เลย 💨
คุณสามารถติดตั้งแพ็กเกจนี้ผ่าน Unity ได้เลย โดยทำตามขั้นตอนนี้:
- เปิด Unity แล้วไปที่
Window > Package Manager - กดปุ่ม
+ด้านบนซ้าย แล้วเลือกAdd package from git URL... - วาง URL นี้ลงไป:
https://github.com/menstood/worldfading.git
- กด Add แล้วรอ Unity ติดตั้งแพ็กเกจให้เรียบร้อย 🎉
- ไปที่
Assets > Create > Material - ตั้ง Shader เป็น
Menstood/BlendTwoCubemapsWithGlowEdge - ตั้งค่า Cubemap ให้กับ:
_CubemapA: Skybox เริ่มต้น_CubemapB: Skybox ปลายทางที่อยาก transition ไป
- เปิดเมนู
Window > Rendering > Lighting - ที่หัวข้อ Environment ให้เลือก Skybox Material เป็นวัสดุที่เพิ่งสร้าง
- เพิ่ม
WorldFading.csไปยัง GameObject ตัวใดก็ได้ในฉาก
-
ถ้าอยากให้ fade แบบ auto:
เรียกPlay()จากสคริปต์ -
ถ้าอยากคุมเอง:
Shader.SetGlobalFloat("_WorldFading", 0.5f); // 0 = A, 1 = B####🔹 5. จบ! Skybox จะเปลี่ยนพร้อม dissolve และ glow เท่ ๆ 🔥
👉 ติดตามผลงานอื่น ๆ ได้ที่ นี่หรือUnity บน Facebook
This project is licensed under the MIT License. See the LICENSE file for details.
