attempting to rotate my sdfs
This commit is contained in:
parent
297442dc88
commit
26d84b7f6a
3 changed files with 12 additions and 4 deletions
|
@ -8,6 +8,7 @@ float _ypos;
|
|||
float3 _dimensions;
|
||||
float3 _center;
|
||||
float _crown;
|
||||
float4x4 _matrix;
|
||||
Texture2D tex; // : register(t0);
|
||||
SamplerState tex_s; // : register(s0);
|
||||
|
||||
|
@ -50,9 +51,6 @@ psIn vs(vsIn input, uint id : SV_InstanceID) {
|
|||
|
||||
o.uv = input.uv;
|
||||
o.color = input.col;
|
||||
// float lighting = dot(o.norm, normalize(float3(-0.3, 0.6, 0.1)));
|
||||
// lighting = (clamp(lighting, 0, 1) * 0.8) + 0.2;
|
||||
// o.color.rgb = o.color.rgb * lighting; // * sk_inst[id].color;
|
||||
return o;
|
||||
}
|
||||
|
||||
|
@ -107,6 +105,8 @@ float oriel(float3 ro, float3 rd) {
|
|||
return dist;
|
||||
}
|
||||
|
||||
|
||||
|
||||
float map(float3 pos) {
|
||||
// pos.x = _center.x + pos.x;
|
||||
// pos.y = _center.y + pos.y;
|
||||
|
@ -122,7 +122,9 @@ float map(float3 pos) {
|
|||
// d.y = _height;
|
||||
// float orielCrown = sdBoxFrame(pos - _center, d, 0.000);
|
||||
|
||||
float box = sdBox(pos - _center, float3(0.1, 0.1, 0.1));
|
||||
// float box = sdBox(pos, float3(0.1, 0.1, 0.1));
|
||||
float box = sdBox((float3)mul(float4(pos, 1), _matrix), float3(0.1, 0.1, 0.1));
|
||||
|
||||
// return lerp(sphere, octo, time);
|
||||
float plane = sdPlane(pos + float3(0, 1.5, 0), float3(0, 1, 0), 0);
|
||||
|
||||
|
@ -206,6 +208,7 @@ psOut ps(psIn input) {
|
|||
|
||||
|
||||
|
||||
|
||||
// if (sdBox(pos - _center, _dimensions / 2) == 0.0) {
|
||||
// float4 clipPos = mul(float4(pos, 1), sk_viewproj[input.view_id]);
|
||||
// float near = 0.0;
|
||||
|
|
|
@ -5,6 +5,7 @@ SKSettings settings = new SKSettings {
|
|||
appName = "oriels",
|
||||
assetsFolder = "add",
|
||||
depthMode = DepthMode.D32,
|
||||
disableUnfocusedSleep = true,
|
||||
};
|
||||
if (!SK.Initialize(settings))
|
||||
Environment.Exit(1);
|
||||
|
|
|
@ -69,6 +69,10 @@ public class Oriel {
|
|||
data.time = (float)Time.Total;
|
||||
buffer.Set(data);
|
||||
|
||||
Matrix matrix = Matrix.TR(bounds.center + Vec3.Up * (float)Math.Sin(Time.Elapsedf), Quat.FromAngles(0, Time.Elapsedf * 60, 0)).Inverse;
|
||||
// matrix. = (float)Math.Sin(Time.Elapsedf);
|
||||
mat.SetMatrix("_matrix", matrix);
|
||||
|
||||
// circle around center
|
||||
// bounds.center = Quat.FromAngles(0, 0, Time.Totalf * 60) * Vec3.Up * 0.3f;
|
||||
// bounds.dimensions = _dimensions * (1f + (MathF.Sin(Time.Totalf * 3) * 0.3f));
|
||||
|
|
Loading…
Add table
Reference in a new issue