मुख्य सामग्री पर जाएँ
Skillpedia
वेबसाइट और UI (frontend)7.2k · #13325

3d-underwater-god-rays

यह क्या करती है

यह स्किल 3D दृश्य में पानी के भीतर सूर्य की रोशनी दिखाने का मार्गदर्शन देती है, जिसमें मछलियों पर चलती रोशनी भी शामिल है। यह Three.js में पानी के भीतर या समुद्र-दृश्य अनुभव बनाने वाले डेवलपर्स के लिए है।

कब इस्तेमाल करें

  • ✓जब कैमरा पानी के नीचे हो और उसमें से रोशनी नीचे आनी चाहिए।
  • ✓जब आप चाहते हैं कि मछलियाँ या वस्तुएँ चलती किरणों से रोशन हों।
  • ✓जब पानी के भीतर दृश्य को लहराती रोशनी और caustic पैटर्न चाहिए।

Skill का लिंक

https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-underwater-god-rays/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-underwater-god-rays/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे मछली टैंक दृश्य में underwater god rays जोड़िए, ताकि पानी में रोशनी की धाराएँ चलें।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट हर व्यू ray के साथ एक बहती लहर का पैटर्न आधे रिज़ॉल्यूशन पर नापता है, ताकि रोशनी के स्तंभ सूर्य की ओर सिमटें और पानी के साथ चलें। वही रोशनी मछलियों पर भी लगती है, जब वे किरणों से होकर तैरती हैं।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

3D Underwater God Rays

Use this when the camera is under the water and the light comes down through it. Reach for a sibling instead in these cases:

  • Sun shafts in air, cut by trees and rooflines: use 3d-sky-rays. Its screen-space radial blur of an occlusion mask is the right tool there. It cannot parallax or carry ripples, so under water keep it only as a low companion for fish shadows (Blue Hour runs it at 0.25).
  • The ocean surface seen from above, with a horizon: use 3d-ultra-realistic-water.
  • Authored shaft planes through one window in a lit interior: use 3d-wood-lighting-scorecard.

Source: extracted from Blue Hour, the living-ocean wallpaper of a Three.js iPhone Duo study. A school of 2,200 Blender sardines turns behind a glass device. The light had to read as sun through water across the whole 38 s camera dolly and on the device's own screen.

Verified stack: Three.js r170, WebGL2, GLSL ShaderMaterials, one HalfFloat render target, and a hand-written ACES pass. No post-processing library.

The mechanism

Sample one drifting swell field across the sun direction, and integrate it along every view ray. Each point in the water is lit by the swell value at its position measured perpendicular to the sun. The shafts are therefore parallel columns in the world. They converge on the sun the way rails converge on a vanishing point, and they slide past the fish when the camera moves. Paint the same shafts in screen space and they stay locked to the lens.

Reuse the working effect

Copy assets/underwater-light.mjs. You pass in your own THREE, and the module does not import a second copy. The demo runs this same module inside Blue Hour's renderer. demo/build.mjs rebuilds it from the Blue Hour sources.

import { createUnderwaterLight, LIGHT_GLSL, WATER_GLSL } from './underwater-light.mjs';

// One uniforms object shared by the water, fish and particle materials.
const uniforms = {
  uSunDirection: { value: new THREE.Vector3(.25, .40, -1).normalize() },   // toward the sun
  uTime: { value: 0 },
  uCameraPosition: { value: camera.position },
  uCameraWorld: { value: camera.matrixWorld },
  uInverseProjection: { value: camera.projectionMatrixInverse },
};
const light = createUnderwaterLight(THREE, { uniforms });   // before creating the materials below
light.setSize(innerWidth * dpr, innerHeight * dpr);          // drawing-buffer pixels, again on resize

// Water: a full-screen quad. Declare uSunDirection, uCameraPosition, uTime,
// uShafts and uShaftTexel, then add ${LIGHT_GLSL}${WATER_GLSL} and in main():
//   vec3 sunRay = ray;
//   color += surfaceUnderside(ray, sunRay);     // also bends sunRay through the ripples
//   ...draw your sun with sunRay...
//   color += underwaterShafts(vUv, ray);
// Fish: declare uSunDirection, then add ${LIGHT_GLSL} and multiply the sun key
// by underwaterDapple(worldPosition, uTime).

// Every frame, in this order:
uniforms.uTime.value = time;
camera.updateMatrixWorld();
light.render(renderer);          // the march, into its own half-resolution target
// then the water, the fish, and one tone map at the end

The numbers that shipped

layer constants
Swell 4 sines along (.86, .51), (−.42, .91), (.13, −.99), (−.97, −.24) at ×1, 1.23, 0.87, 1.41; drift 0.29, 0.24, 0.19, 0.15 rad/s; domain warp 0.62
Across the sun scale 1.3, so the main period is about 4.8 world units against a frame about 22 units wide at the school
Shaft focus smoothstep(−0.05, 1, swell)², faded by exp(−0.012 · distance to the surface along the sun)
Caustic web the swell again at ×2.6 and 1.35× speed, `(1 −
March 26 steps, t = 4 + 50·f², weight exp(−0.06t)·(0.08 + f), divided by the weight sum; a stable per-pixel jitter (interleaved gradient noise) instead of temporal noise
Sun blend total = mix(total, 0.16, μ^28), where μ = ray·sun
Phase 0.7 + 1.1μ^5 + 0.9μ^40; rays below the horizon × mix(0.45, 1, smoothstep(−0.45, 0.35, ray.y))
Gain (0.16, 0.40, 0.47) × 3.6, linear HDR, tone-mapped once at the end
Buffer 0.5 × the drawing buffer, HalfFloat, single-sampled (the march is soft, so MSAA buys nothing), upsampled with a 4-tap tent at ½ texel
Surface underside plane at y = 12; network `(1 −
अक्सर पूछे जाने वाले सवाल

क्या यह हवा में सूर्य की किरणों के लिए है?

नहीं। स्किल हवा में सूर्य की किरणों के लिए एक अलग सहयोगी स्किल की ओर इशारा करती है।

यह प्रभाव किस रिज़ॉल्यूशन पर गिना जाता है?

स्किल इस प्रभाव को आधे रिज़ॉल्यूशन पर गिनती है।

क्या यह रोशनी दूसरी वस्तुओं को प्रभावित कर सकती है?

हाँ। वही रोशनी उन मछलियों पर लगती है जो किरणों से होकर तैरती हैं।

जानकारी

लेखक का मूल विवरण

Add volumetric underwater god rays to a Three.js scene, marching one drifting swell field along every view ray at half resolution so the light shafts converge on the sun, parallax with the camera and carry rippling caustic streaks, with a shimmering surface underside, a sun that wobbles through the ripples, and the same light dappling fish as they swim through the beams. Use for underwater scenes, oceans seen from below, aquariums, reefs, kelp forests, diving and shipwreck scenes, schools of fish, sunbeams or light shafts through water, caustics, "rays of light shining through the ocean", or w

repo: MengTo/Skills

लोकप्रियता

GitHub स्टार
7.2k
रैंकिंग में स्थान
#13325
लाइसेंस
MIT
अपडेट की गई
1/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

3d-cloth-material

7.2k

आपके एजेंट को Three.js में असली बुने हुए कपड़े जैसा दिखने वाला मटीरियल बनाने में मदद करती है, जिसमें धागों की बुनाई, हल्की चमक, प्राकृतिक सिलवटें, किनारे और सीवन हों।

कोडिंगवेबसाइट और UI (frontend)

3d-falling-leaves

7.2k

आपके एजेंट को 3D दृश्य में असली लगने वाली गिरती पत्तियाँ जोड़ने देती है, जो लुढ़कती हैं, हवा के साथ बहती हैं और कैमरा हिलने पर दोबारा इस्तेमाल होती हैं।

कोडिंगवेबसाइट और UI (frontend)

3d-four-seasons

7.2k

आपके एजेंट को 3D दृश्य में वसंत, गर्मी, शरद और सर्दी के रूप जोड़ने देती है, जिसमें हरियाली, रोशनी, आसमान और बर्फ़ बिना दृश्य दोबारा बनाए बदलते हैं।

कोडिंगवेबसाइट और UI (frontend)

3d-high-poly-models

7.2k

आपके एजेंट को चिकने आकार और विश्वसनीय किनारों वाले विस्तृत 3D मॉडल बनाने देती है, और फिर वेब पर अच्छे चलने वाले हल्के संस्करण तैयार करती है।

कोडिंगवेबसाइट और UI (frontend)

मिलती-जुलती skills