شعار Realtime Wet Surfaces

Realtime Wet Surfaces

مؤسسة
SummerEngine
realtime-wet-surfaces

Real-time wetness on existing materials without losing their values — value-copying wet shader, geometry-driven wet mask, instance-uniform wet amount.

نظرة عامة

الناشرSummerEngine
المستودعsummer
اسم المهارةrealtime-wet-surfaces
النجوم
91
التفريعات
8
الملفات المرفقة
1
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 1

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها SummerEngine على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Realtime Wet Surfaces في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/SummerEngine/summer/tree/main/library/skills/realtime-wet-surfaces
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/SummerEngine/summer.git /tmp/summer
mkdir -p .claude/skills
cp -r /tmp/summer/library/skills/realtime-wet-surfaces .claude/skills/realtime-wet-surfaces
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Realtime Wet Surfaces في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Realtime Wet Surfaces تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Realtime Wet Surfaces بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Real-Time Wet Surfaces (Value-Preserving Wet Materials)

Outcome

Implement a real-time wetness effect in Summer Engine that can be applied to existing materials without losing their configured values (albedo, metallic, roughness, textures). The wet mask is driven by geometry alone (upward-facing surfaces collect wetness first), with a global/per-instance wet amount that can be animated at runtime. This follows the source technique: a pre-configured shader swap that keeps the standard material's values, fed by a custom-function bridge.

When to Use

  • Rain, wet caves, shorelines, or post-rain scenes where surfaces should darken and become glossy in real time.
  • You need to wet many existing materials without re-authoring each one or losing its parameter values.
  • You want a wetness amount that a gameplay system (rain zone, weather controller) can drive at runtime.

Core Principle

The source technique's key idea is separation of wetness from material authoring: the wet logic is a self-contained graph/function that receives material values and injects a wet mask, so enabling wetness is a swap, not a rewrite.

How the source concepts map to Summer Engine:

Source conceptSummer Engine equivalent
Standard lit material with retained valuesStandardMaterial3D values copied into a ShaderMaterial by a one-time converter
Pre-configured shader-graph swapShared wet-enabled .gdshader; swap the material once, keep all parameter values
Custom-function node carrying values into the graphShader uniforms + instance uniforms (set_instance_shader_parameter) or RenderingServer global shader parameters for scene-wide wet state
Wet mask from geometry shape aloneFragment mask from world-space normal up-facing component (world_normal.y), optionally broken up by world-position noise
Planned heightmap flowSample a heightmap texture and offset the wet mask along its gradient (future extension; not evidenced in source)

Constraint: the engine cannot inject custom nodes into a StandardMaterial3D at runtime. The equivalent of "swap in the pre-configured shader while keeping all values" is a converter that copies StandardMaterial3D parameters into the wet shader (below). The alternative — leaving StandardMaterial3D untouched and overlaying wetness via decals or post-processing — does not match the source's material-preserving architecture and is not recommended here.

Scene / Node Shape

Scene
├── Node3D (level)
│   ├── MeshInstance3D × N
│   │     └── Surface overrides: ShaderMaterial (wet-enabled shader, one shared .gdshader)
│   │           instance uniform `wet_amount` driven per object or globally
│   └── RainZone: Area3D (optional)
│         └── body_entered/exited signals → WetnessController
└── WetnessController: Node
      └── typed GDScript; animates wet_amount up while raining, down while drying

Implementation Steps

1. Write the shared wet-enabled spatial shader

Preserve the PBR parameters as uniforms and compute the wet mask from geometry. Fragment-stage NORMAL is view-space, so pass a world-space normal from the vertex stage — otherwise the "upward-facing" mask rotates with the camera.

glsl
shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_back;

// Values copied from the original StandardMaterial3D by the converter
uniform vec4 albedo_color : source_color = vec4(1.0);
uniform sampler2D albedo_tex : filter_linear_mipmap;
uniform float metallic : hint_range(0.0, 1.0) = 0.0;
uniform float roughness : hint_range(0.0, 1.0) = 0.5;

// Wet state
instance uniform float wet_amount : hint_range(0.0, 1.0) = 0.0;
uniform float up_bias : hint_range(0.0, 1.0) = 0.35;    // wetness starts below fully-upward
uniform float darkening : hint_range(0.0, 1.0) = 0.55;  // how much wet albedo darkens
uniform float wet_roughness : hint_range(0.0, 1.0) = 0.08;
uniform float noise_scale = 8.0;
uniform sampler2D droplet_noise : filter_linear_mipmap, repeat_enable;

varying vec3 world_normal;
varying vec3 world_pos;

void vertex() {
    world_normal = (MODEL_MATRIX * vec4(NORMAL, 0.0)).xyz;
    world_pos = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz;
}

void fragment() {
    vec4 alb := texture(albedo_tex, UV) * albedo_color;
    vec3 wn := normalize(world_normal);

    // Geometry-driven wet mask: upward-facing surfaces collect wetness first
    float facing := clamp(wn.y, 0.0, 1.0);
    float mask := smoothstep(up_bias, 1.0, facing) * wet_amount;

    // Break up the mask so it reads as weathering, not a flat shader pass
    mask *= 0.75 + 0.25 * texture(droplet_noise, world_pos.xz * noise_scale).r;

    ALBEDO = mix(alb.rgb, alb.rgb * (1.0 - darkening), mask);
    ROUGHNESS = mix(roughness, wet_roughness, mask);
    METALLIC = metallic;
    SPECULAR = mix(0.5, 0.9, mask);  // glossy film sells "wet"
}

Assumes near-uniform mesh scale; for heavily non-uniform scale, use the inverse-transpose normal transform instead of MODEL_MATRIX directly.

2. Convert existing materials while preserving their values

This is the source's "swap in the pre-configured shader; all values retained" step. Run once (editor tool or import-time), not per frame.

gdscript
@tool
func convert_to_wet_material(src: StandardMaterial3D, wet_shader: Shader) -> ShaderMaterial:
    var m := ShaderMaterial.new()
    m.shader = wet_shader
    m.set_shader_parameter("albedo_color", src.albedo_color)
    m.set_shader_parameter("metallic", src.metallic)
    m.set_shader_parameter("roughness", src.roughness)
    if src.albedo_texture != null:
        m.set_shader_parameter("albedo_tex", src.albedo_texture)
    return m

Extend the copy list for any extra StandardMaterial3D properties your project uses (normal maps, emission, UV transforms). Keep the converter in one place so every wet-enabled material is produced identically.

3. Drive wetness at runtime with instance uniforms

gdscript
class_name WetnessController
extends Node

@export var targets: Array[GeometryInstance3D] = []
@export_range(0.0, 1.0) var wet_rate: float = 0.15  # per second while raining
@export_range(0.0, 1.0) var dry_rate: float = 0.05  # per second after rain

var raining := false
var _wet: float = 0.0

func _process(delta: float) -> void:
    var goal := 1.0 if raining else 0.0
    var rate := wet_rate if raining else dry_rate
    _wet = move_toward(_wet, goal, rate * delta)
    for gi: GeometryInstance3D in targets:
        gi.set_instance_shader_parameter("wet_amount", _wet)

Use Area3D rain zones to toggle raining for objects inside them. For scene-wide weather without enumerating targets, register a global shader parameter once (RenderingServer.global_shader_parameter_add("global_wet_amount", RenderingServer.GLOBAL_VAR_TYPE_FLOAT, 0.0)) and set it per frame with RenderingServer.global_shader_parameter_set; read it in the shader instead of the instance uniform.

4. Planned extension: heightmap-guided flow

The source author states heightmap support so wetness flows along map bumps is planned, not shipped. To implement it: sample a heightmap texture in the fragment stage and bias the wet mask along its gradient (e.g., offset world_pos.xz lookups downhill using the height texture derivatives) so streaks follow surface relief. Do not treat this as part of the evidenced technique.

Tunables

ParameterTypical ValueNotes
wet_amount0–1, animatedInstance uniform or global shader parameter
up_bias0.35Lower = walls and slopes also wet; higher = only flat tops
darkening0.4–0.6Wet albedo multiplier = 1.0 - darkening
wet_roughness0.05–0.15Lower = glassy puddle look
noise_scale4–16World-space breakup frequency
wet_rate / dry_rate0.15 / 0.05 per sAsymmetric rates feel natural (wets fast, dries slow)

Failure Modes & Gotchas

  • View-space normal mistake: using fragment NORMAL directly makes the up-facing mask rotate with the camera. Always pass world normal from vertex() via a varying.
  • Expecting in-place injection: the engine cannot add wet logic to a live StandardMaterial3D. The value-preserving step is the one-time conversion, not runtime patching.
  • Duplicate shaders per material: keep ONE shared .gdshader; per-material differences live in uniforms, per-object state in instance uniforms. Otherwise you pay shader compilation and draw-call overhead.
  • Over-darkening: on already-dark albedos, clamp the darkened result or lower darkening.
  • Transparent/unshaded materials: out of scope; this skill targets opaque PBR surfaces.
  • Skinned meshes: verify the MODEL_MATRIX world-normal transform still behaves with skeletal animation before relying on the up-facing mask.

Verification

  1. With wet_amount = 0, converted materials render identically to their original StandardMaterial3D values (compare albedo/roughness response under a fixed light).
  2. Raising wet_amount darkens and glosses upward-facing surfaces; downward-facing and underside faces stay mostly dry.
  3. Rotating the camera does NOT shift the wet mask boundaries (confirms world-space normal).
  4. WetnessController animates wet/dry transitions smoothly with no per-material edits during play.
  5. Multiple meshes share one shader resource; adding wet-enabled objects does not add new shader variants.

Confidence

extracted — the architecture (material-preserving wet swap, custom-function value bridge, geometry-only mask, planned heightmap flow) comes from a public post that showed the technique in another engine; no code was published. The mapping, shader, and scripts here are engineering guidance consistent with that post, not source-extracted implementation and not verified inside Summer Engine.

Evidence

  • A public X post describing the technique (demo video only, no code).

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة ما دامت المهارة محمّلة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Realtime Wet Surfaces؟

Real-time wetness on existing materials without losing their values — value-copying wet shader, geometry-driven wet mask, instance-uniform wet amount.

لماذا تستخدم Realtime Wet Surfaces على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Realtime Wet Surfaces عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Realtime Wet Surfaces في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/SummerEngine/summer/tree/main/library/skills/realtime-wet-surfaces. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Realtime Wet Surfaces؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Realtime Wet Surfaces؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Realtime Wet Surfaces معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Realtime Wet Surfaces مجانية؟

نعم. نشرها SummerEngine على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇