hecomi / uraymarching Goto Github PK
View Code? Open in Web Editor NEWRaymarching Shader Generator in Unity
Home Page: http://tips.hecomi.com/entry/2019/01/27/233137
License: MIT License
Raymarching Shader Generator in Unity
Home Page: http://tips.hecomi.com/entry/2019/01/27/233137
License: MIT License
deleted.... sorted my own issue.. not a bug
Setting to full screen makes it only render on the inner half of the screen, you can fix this by changing
#ifdef FULL_SCREEN
o.pos = v.vertex;
#else
To
#ifdef FULL_SCREEN
o.pos = UnityObjectToClipPos(v.vertex);
#else
In whatever shader your generated code imports, for example at the bottom mine had
...
ZWrite [_ZWrite]
CGPROGRAM
#include "Assets\uRaymarching\Shaders\Include\Legacy/ForwardBaseStandard.cginc"
#pragma target 3.0
#pragma vertex Vert
#pragma fragment Frag
#pragma multi_compile_instancing
#pragma multi_compile_fog
#pragma multi_compile_fwdbase
ENDCG
...
So I needed to modify that line in
#include "Assets\uRaymarching\Shaders\Include\Legacy/ForwardBaseStandard.cginc"
Unity 5.6.x does not support UNITY_POSITION()
, so replace it with simple float4 pos : SV_POSITION
expression.
There are no fractals displays properly on the Oculus Quest (running Android).
If someone knows how to work around this, please reply!
Hi,
I am doing the union of two primitives in my distance function. But how can I have a different rendering between both? In my scene I'd like one to be textured and the others keep a unique color.
Thanks.
I think I followed the how to use instructions correctly.
I have a generater, a shader and material.
The only thing I added to the shader was the distance function that I copied and pasted thats supposed to be the morphing sphere cube on the main page.
When initially making(exporting) the shader and/or material I get these errors on console. I'm not sure if that's why my cube with the material applied doesn't do anything? Hoping to get some thoughts on this.
I'm trying to make a Cube map from raymarched scene but It is black!
https://docs.unity3d.com/ScriptReference/Camera.RenderToCubemap.html
https://lmhpoly.com/how-to-generate-the-environment-cubemap-in-unity/
Hey hecomi. I'm really impressed by what you have built. I really love how much you can customise it. I was wandering if it is possible to use your library to do a volume render of a 3d Texture. Basically, I've got a set of images that have split a smoke image into image slices. I want to be able join all the 2d Textures as one volume (one 3d Texture) and then ray march through them with some noise level. Below is an image of what I would like.
I would be really good if there was a way to load the cube with a 3d Texture on the fly.
Is this possibly?
I appreciate any help on this. Thanks
Hi, I found a rendering issue when I enabled Depth Texture on the Camera or on the URP Settings Asset. I think the issue is only in VR. I'm using OpenVR and Single Pass, and I tried both Unity 2019.4.3 with URP 7.3.1 and Unity 2019.4.12 with URP 7.5.1.
I would greatly appreciate if you can take a look and suggest or push a fix! Great project! : )
I developed a sample project with uRaymarching. There is no problem with PC. But, when I built project for mobile platform, i receive 5-10 fps. I also receive color problem. Character that i applied the shader turns black on mobile platform.
That's my project link : https://github.com/tunchasan/Blob-Runner3D-Clone
This is the shader : https://github.com/tunchasan/Blob-Runner3D-Clone/blob/main/Assets/_Main/Shader/TransformProvider.shader
I'm looking for some help :)
Is it possible to upgrade URaymarching shaders to URP? Also, Are they compatible with SRP Batcher?
BlobCharacterShader.zip
Stereo 3D is somehow broken with RaymarchingRenderer (it seems OK with RaymarchingObjects). I can't be sure but I think each eye is getting exactly the same image.
Unity 2018.3.2f1
Im unable to make subtraction of two cubes.
visual glitches appear:
distance function:
inline float DistanceFunction(float3 pos)
{
float x = Box(pos,float3(1,1,1));
pos-= float3(0.5,0.5,0.5);
float y = Box(pos,float3(1,1,1));
//float v = Sphere(pos, 1); (uncoment and change -x to -v below to see it working with sphere)
return max(y,-x);
}
Hello,
First great coding and asset. Code is very clean and easy to read.
I am running your examples scenes from Windows and DX11. I did not try DX9. And the scene hex floor works good, while Mod world and Sphere box morphing don't.
I tried to use a simple: return Sphere(pos, 0.5);
too but the cube still gets drawn.
So I guess there are some differences while running DirectX, do you plan to get it compatible at some point? Or you don't have a Windows computer and hope someone could participate?
Thanks.
Dear Hecomi,
I'm trying to render a MandelBulb, one described with a distance formula on http://blog.hvidtfeldts.net/index.php/2011/09/distance-estimated-3d-fractals-v-the-mandelbulb-different-de-approximations/. However, the screen is entirely black. Could you please give me some heads up on what I am doing wrong? I have also included the test project in a zip file. I have tried to stay as close to the working "Mod World" example from this repo for testing purposes.
Best regards,
daBlesr
Unity 2018.3.2f1
After creating new Shader generator, naming it and clicking Export. this exception occurs:
`Shader error in 'Raymarching/Tester': invalid subscript 'projPos' at Assets/uRaymarching/Shaders/Include/DeferredDirect.cginc(50) (on d3d11)
Compiling Vertex program with UNITY_PASS_DEFERRED
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR`
Really neat project. It doesn't work on Unity 2017.2/OSX when switching over to Metal API (which I want for a particular project that uses Compute Shaders on Metal as it's faster than OpenGL on my project), just switches over to a blank texture. Wondering what it would take to get that working.
from #5.
I'm keen to use uRaymarching in VR but I've hit a couple of snags. I'll write up this one first as it's simple to describe.
I need to use the forward renderer to enable MSAA (which I guess won't benefit the raymarched objects but will benefit the rest of the scene).
However when I switch to forward - the placeholder geometry is rendered as well as the raymarched "geometry".
It plays a lot nicer with version control
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.