Skip to content

Commit

Permalink
wormhole shape
Browse files Browse the repository at this point in the history
  • Loading branch information
malytomas committed Jun 13, 2024
1 parent be86099 commit a45a898
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion externals/cage
Submodule cage updated 74 files
+1 −1 data/cage/shader/engine/font.glsl
+32 −50 data/cage/shader/engine/fragment.glsl
+5 −6 data/cage/shader/engine/uniforms.glsl
+2 −0 data/cage/shader/engine/vertex.glsl
+17 −2 data/cage/shader/functions/attenuation.glsl
+67 −0 data/cage/shader/functions/biplanar.glsl
+22 −22 data/cage/shader/functions/brdf.glsl
+42 −0 data/cage/shader/functions/common.glsl
+49 −0 data/cage/shader/functions/fbm.glsl
+17 −1 data/cage/shader/functions/hash.glsl
+3 −3 data/cage/shader/functions/hsvToRgb.glsl
+16 −0 data/cage/shader/functions/makeTangentSpace.glsl
+35 −0 data/cage/shader/functions/noise.glsl
+1 −1 data/cage/shader/functions/poissonDisk26.glsl
+1 −1 data/cage/shader/functions/poissonDisk3.glsl
+1 −1 data/cage/shader/functions/poissonDisk4.glsl
+1 −1 data/cage/shader/functions/poissonDisk5.glsl
+1 −1 data/cage/shader/functions/poissonDisk6.glsl
+1 −1 data/cage/shader/functions/poissonDisk64.glsl
+1 −1 data/cage/shader/functions/poissonDisk7.glsl
+1 −1 data/cage/shader/functions/poissonDisk8.glsl
+11 −13 data/cage/shader/functions/randomFunc.glsl
+2 −2 data/cage/shader/functions/reconstructPosition.glsl
+7 −0 data/cage/shader/functions/restoreNormalMap.glsl
+75 −0 data/cage/shader/functions/simplex.glsl
+8 −5 data/cage/shader/gui/colorPicker.glsl
+2 −2 data/cage/shader/gui/element.glsl
+1 −1 data/cage/shader/gui/font.glsl
+2 −2 data/cage/shader/gui/image.glsl
+5 −3 externals/wamr/CMakeLists.txt
+1 −1 externals/wamr/wamr
+4 −37 schemes/sound.scheme
+11 −6 sources/asset-processor/model.cpp
+29 −28 sources/asset-processor/sound.cpp
+0 −6 sources/asset-processor/texts.cpp
+1 −0 sources/include/cage-core/audioAlgorithms.h
+1 −4 sources/include/cage-core/audioChannelsConverter.h
+2 −5 sources/include/cage-core/imageImport.h
+2 −6 sources/include/cage-core/meshAlgorithms.h
+2 −0 sources/include/cage-core/texts.h
+2 −13 sources/include/cage-engine/assetStructs.h
+26 −5 sources/include/cage-engine/core.h
+0 −1 sources/include/cage-engine/inputs.h
+15 −28 sources/include/cage-engine/scene.h
+0 −1 sources/include/cage-engine/screenList.h
+3 −12 sources/include/cage-engine/sound.h
+2 −1 sources/include/cage-engine/speaker.h
+1 −2 sources/include/cage-engine/speakerList.h
+1 −4 sources/include/cage-engine/virtualReality.h
+9 −8 sources/include/cage-engine/voices.h
+1 −2 sources/include/cage-simple/engine.h
+21 −0 sources/libcore/assets/texts.cpp
+9 −0 sources/libcore/audio/audio.cpp
+2 −6 sources/libcore/audio/channelsConverter.cpp
+1 −1 sources/libcore/image/dds.cpp
+2 −2 sources/libcore/image/imageImport.cpp
+5 −5 sources/libcore/image/imageIo.cpp
+1 −1 sources/libcore/mesh/importConvert.cpp
+3 −3 sources/libcore/mesh/meshAlgorithms.cpp
+1 −0 sources/libcore/wasm.cpp
+5 −12 sources/libengine/assets/sound.cpp
+33 −26 sources/libengine/graphics/renderPipeline.cpp
+4 −4 sources/libengine/sceneShadowmapFitting.cpp
+15 −15 sources/libengine/sound/sound.cpp
+5 −5 sources/libengine/sound/speaker.cpp
+28 −19 sources/libengine/sound/voices.cpp
+3 −3 sources/libengine/virtualReality/openxr.cpp
+1 −1 sources/libsimple/cameraRay.cpp
+33 −29 sources/libsimple/gameloop.cpp
+4 −4 sources/libsimple/graphics.cpp
+12 −19 sources/libsimple/sound.cpp
+2 −0 sources/test-core/exceptions.cpp
+3 −5 sources/test-core/mesh.cpp
+24 −9 sources/test-core/strings.cpp
4 changes: 4 additions & 0 deletions sources/modesConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ namespace unnatural
&sdfTube,
&sdfTwistedHexagonalPrism,
&sdfTwistedPlane,
&sdfWormhole,
};

static constexpr uint32 shapeModesCount = sizeof(shapeModeFunctions) / sizeof(shapeModeFunctions[0]);
Expand Down Expand Up @@ -109,6 +110,7 @@ namespace unnatural
"tube",
"twistedhexagonalprism",
"twistedplane",
"wormhole",
};

static_assert(shapeModesCount == sizeof(shapeModeNames) / sizeof(shapeModeNames[0]), "number of functions and names must match");
Expand Down Expand Up @@ -152,6 +154,8 @@ namespace unnatural
return true;
if (name == "twistedplane")
return true;
if (name == "wormhole")
return true;
return false;
}();
}
Expand Down
7 changes: 7 additions & 0 deletions sources/sdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,4 +395,11 @@ namespace unnatural
const Real s = min(s1, s2);
return smoothMin(c, s, 100);
}

Real sdfWormhole(const Vec3 &p)
{
const Real x = min(length(Vec2(p[0], p[2])) - 1400, 0);
const Real y = p[1];
return 700 - length(Vec2(x, y));
}
}
1 change: 1 addition & 0 deletions sources/sdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ namespace unnatural
Real sdfTube(const Vec3 &pos);
Real sdfTwistedHexagonalPrism(const Vec3 &pos);
Real sdfTwistedPlane(const Vec3 &p);
Real sdfWormhole(const Vec3 &p);
}

#endif

0 comments on commit a45a898

Please sign in to comment.