Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics

Andi McClure

A member registered Sep 14, 2017

Recent community posts

There are various functions that are used in the built-in snippets. For example looking at the MaterialSnippets I see clamp(), tex3D_2D() and tex2Dlod().  Some of these are in the Cg documentation, like tex2Dlod. But tex3D_2D is not, and tex3D_2D seems to be doing something unusual (it's like it's overlaying 2 copies of a 2d texture on itself?)

Can you confirm that *all* of the "snippets" (not just materials?) have the Cg standard functions available?

Can you document the additional symbols/functions which we can assume are present in the snippet namespace? Alternately, is there a file somewhere that we can browse their names?

Finally, some of the input types for MaterialSnippet are not documented. The one which interests me is "Texture 3D", which I would love to use. What file format does this expect for its input? Unity does not as far as I know have a standard file format for 3D textures.


I am looking at the instructions for material snippets:

…and I have tried creating a material snippet by duplicating one of the material snippets in Snippets/Materials.

I find that I can return a single color, and that color will be dutifully shaded according to lighting and then shadowed.

But let's say I want to write my own shading— I want to draw a solid color, or cel-shade, or rim shade or whatnot. Can this be customized?

I have OS X 10.13.2 and Unity 2018.2.0b9 installed from Unity Hub. I imported the Raymarching Toolkit unityproject into a new empty project. During the import I got several warnings, which I did not write down. I then attempted to add a "Raymarcher" object to the project by right-clicking. Upon adding, I got the following error.

On 2017.4.6f1, I do not have any problems with the raymarch toolkit at all. If I create a working raymarch-toolkit scene in 2017.4.6f1, and import it into 2018.2.0b9, I get again an exception concerning set_colorKeys when I hit "play" and the scene does not run.

UnityException: set_colorKeys is not allowed to be called during serialization, call it from OnEnable instead. Called from ScriptableObject 'ObjectSnippet'.

See "Script Serialization" page in the Unity Manual for further details.
RaymarchingToolkit.GradientTexture.get_Default () (at <f3d48e4ad67446a5b3113996fcbb6ecb>:0)
RaymarchingToolkit.GradientTexture..ctor () (at <f3d48e4ad67446a5b3113996fcbb6ecb>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Can you clarify— It says it's distributed as "a DLL"— is that a *Windows* DLL or a *.NET bytecode* DLL?