Bär wartet nach aufwachen etc

This commit is contained in:
2026-01-25 17:22:11 +01:00
parent 6504147456
commit e38a2b05e7
384 changed files with 132389 additions and 54 deletions
@@ -0,0 +1,21 @@
void DistortUV_float(float2 UV, float Amount, out float2 Out)
{
float time = _Time.y;
UV.y += Amount * 0.01 * (sin(UV.x * 3.5 + time * 0.35) + sin(UV.x * 4.8 + time * 1.05) + sin(UV.x * 7.3 + time * 0.45)) / 3.0;
UV.x += Amount * 0.12 * (sin(UV.y * 4.0 + time * 0.50) + sin(UV.y * 6.8 + time * 0.75) + sin(UV.y * 11.3 + time * 0.2)) / 3.0;
UV.y += Amount * 0.12 * (sin(UV.x * 4.2 + time * 0.64) + sin(UV.x * 6.3 + time * 1.65) + sin(UV.x * 8.2 + time * 0.45)) / 3.0;
Out = UV;
}
void DistortUV_half(half2 UV, half Amount, out half2 Out)
{
half time = _Time.y;
UV.y += Amount * 0.01 * (sin(UV.x * 3.5 + time * 0.35) + sin(UV.x * 4.8 + time * 1.05) + sin(UV.x * 7.3 + time * 0.45)) / 3.0;
UV.x += Amount * 0.12 * (sin(UV.y * 4.0 + time * 0.50) + sin(UV.y * 6.8 + time * 0.75) + sin(UV.y * 11.3 + time * 0.2)) / 3.0;
UV.y += Amount * 0.12 * (sin(UV.x * 4.2 + time * 0.64) + sin(UV.x * 6.3 + time * 1.65) + sin(UV.x * 8.2 + time * 0.45)) / 3.0;
Out = UV;
}
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 84eeacf7409dd9e4a8cbfab15c1cb3c7
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 297566
packageName: Water Stylized Shader Orto & Perspective Camera
packageVersion: 1.0
assetPath: Assets/AureDevGames/Water Stylized Shader Orto & Perspective Camera/Shader/HLSL/DistortUV.hlsl
uploadId: 700359
@@ -0,0 +1,63 @@
float3 GerstnerWave(float3 position, float steepness, float wavelength, float speed, float direction, inout float3 tangent, inout float3 binormal, float globalOffset)
{
// Normalizar la dirección para la propagación de la ola
direction = direction * 2 - 1;
float2 d = normalize(float2(cos(3.14159 * direction), sin(3.14159 * direction)));
// Número de onda
float k = 2 * 3.14159 / wavelength;
// Calcular la fase de la ola, incluyendo el desplazamiento global
float f = k * (dot(d, position.xz) - speed * _Time.y + globalOffset);
// Amplitud de la ola
float a = steepness / k;
// Ajustar el tangente y el binormal para las normales
tangent += float3(
-d.x * d.x * (steepness * sin(f)),
d.x * (steepness * cos(f)),
-d.x * d.y * (steepness * sin(f))
);
binormal += float3(
-d.x * d.y * (steepness * sin(f)),
d.y * (steepness * cos(f)),
-d.y * d.y * (steepness * sin(f))
);
// Retornar el desplazamiento de la ola en el plano XZ y la altura vertical
return float3(
d.x * (a * cos(f)), // Desplazamiento en X
a * sin(f), // Desplazamiento en Y (altura)
d.y * (a * cos(f)) // Desplazamiento en Z
);
}
void GerstnerWaves_float(float3 position, float steepness, float wavelength, float speed, float4 directions, float tileSize, out float3 Offset, out float3 normal)
{
// Calcular el desplazamiento global para las olas en base a la posición absoluta
float globalOffsetX = floor(position.x / tileSize) * tileSize;
float globalOffsetZ = floor(position.z / tileSize) * tileSize;
// Envolver la posición X y Z usando fmod para asegurar el tileado, manteniendo el Y sin cambios
float3 tiledPosition = float3(
fmod(position.x, tileSize), // Envolver eje X
position.y, // Y sin cambios
fmod(position.z, tileSize) // Envolver eje Z
);
// Inicializar el desplazamiento y los vectores de tangente/binormal
Offset = float3(0, 0, 0);
float3 tangent = float3(1, 0, 0);
float3 binormal = float3(0, 0, 1);
// Aplicar las olas Gerstner a las direcciones, con el desplazamiento global en X y Z
Offset += GerstnerWave(tiledPosition, steepness, wavelength, speed, directions.x, tangent, binormal, globalOffsetX + globalOffsetZ);
Offset += GerstnerWave(tiledPosition, steepness, wavelength, speed, directions.y, tangent, binormal, globalOffsetX + globalOffsetZ);
Offset += GerstnerWave(tiledPosition, steepness, wavelength, speed, directions.z, tangent, binormal, globalOffsetX + globalOffsetZ);
Offset += GerstnerWave(tiledPosition, steepness, wavelength, speed, directions.w, tangent, binormal, globalOffsetX + globalOffsetZ);
// Normalizar el producto cruzado de binormal y tangente para obtener la normal
normal = normalize(cross(binormal, tangent));
}
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 0feec35a2e5b9e24cbf36fc074d44390
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 297566
packageName: Water Stylized Shader Orto & Perspective Camera
packageVersion: 1.0
assetPath: Assets/AureDevGames/Water Stylized Shader Orto & Perspective Camera/Shader/HLSL/GrestnerWaves.hlsl
uploadId: 700359
@@ -0,0 +1,53 @@
half3 RGBToHSV(half3 In)
{
half4 K = half4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
half4 P = lerp(half4(In.bg, K.wz), half4(In.gb, K.xy), step(In.b, In.g));
half4 Q = lerp(half4(P.xyw, In.r), half4(In.r, P.yzx), step(P.x, In.r));
half D = Q.x - min(Q.w, Q.y);
half E = 1e-10;
return half3(abs(Q.z + (Q.w - Q.y)/(6.0 * D + E)), D / (Q.x + E), Q.x);
}
half3 HSVToRGB(half3 In)
{
half4 K = half4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
half3 P = abs(frac(In.xxx + K.xyz) * 6.0 - K.www);
return In.z * lerp(K.xxx, saturate(P - K.xxx), In.y);
}
void HSVLerp_half(half4 A, half4 B, half T, out half4 Out)
{
A.xyz = RGBToHSV(A.xyz);
B.xyz = RGBToHSV(B.xyz);
half t = T; // used to lerp alpha, needs to remain unchanged
half hue;
half d = B.x - A.x; // hue difference
if(A.x > B.x)
{
half temp = B.x;
B.x = A.x;
A.x = temp;
d = -d;
T = 1-T;
}
if(d > 0.5)
{
A.x = A.x + 1;
hue = (A.x + T * (B.x - A.x)) % 1;
}
if(d <= 0.5) hue = A.x + T * d;
half sat = A.y + T * (B.y - A.y);
half val = A.z + T * (B.z - A.z);
half alpha = A.w + t * (B.w - A.w);
half3 rgb = HSVToRGB(half3(hue,sat,val));
Out = half4(rgb, alpha);
}
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 51c4f325e435fdd4187eaa3ec9fc9e94
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 297566
packageName: Water Stylized Shader Orto & Perspective Camera
packageVersion: 1.0
assetPath: Assets/AureDevGames/Water Stylized Shader Orto & Perspective Camera/Shader/HLSL/InterpolateHSV.hlsl
uploadId: 700359
@@ -0,0 +1,47 @@
float LightingSpecular(float3 L, float3 N, float3 V, float smoothness)
{
float3 H = SafeNormalize(float3(L) + float3(V));
float NdotH = saturate(dot(N, H));
return pow(NdotH, smoothness);
}
void MainLighting_float(float3 normalWS, float3 positionWS, float3 viewWS, float smoothness, out float specular)
{
specular = 0.0;
#ifndef SHADERGRAPH_PREVIEW
smoothness = exp2(10 * smoothness + 1);
normalWS = normalize(normalWS);
viewWS = SafeNormalize(viewWS);
Light mainLight = GetMainLight(TransformWorldToShadowCoord(positionWS));
specular = LightingSpecular(mainLight.direction, normalWS, viewWS, smoothness);
#endif
}
void AdditionalLighting_float(float3 normalWS, float3 positionWS, float3 viewWS, float smoothness, float hardness, out float3 specular)
{
specular = 0;
#ifndef SHADERGRAPH_PREVIEW
smoothness = exp2(10 * smoothness + 1);
normalWS = normalize(normalWS);
viewWS = SafeNormalize(viewWS);
// additional lights
int pixelLightCount = GetAdditionalLightsCount();
for (int i = 0; i < pixelLightCount; ++i)
{
Light light = GetAdditionalLight(i, positionWS);
float3 attenuatedLight = light.color * light.distanceAttenuation * light.shadowAttenuation;
float specular_soft = LightingSpecular(light.direction, normalWS, viewWS, smoothness);
float specular_hard = smoothstep(0.005,0.01,specular_soft);
float specular_term = lerp(specular_soft, specular_hard, hardness);
specular += specular_term * attenuatedLight;
}
#endif
}
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 9ec46a2fd8a98924e9af6e1cf4be7007
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 297566
packageName: Water Stylized Shader Orto & Perspective Camera
packageVersion: 1.0
assetPath: Assets/AureDevGames/Water Stylized Shader Orto & Perspective Camera/Shader/HLSL/MainLighting.hlsl
uploadId: 700359