Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics

Documentation for snippet functions / MaterialSnippet?

A topic by Andi McClure created Jul 22, 2018 Views: 104 Replies: 2
Viewing posts 1 to 3

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.


great question!

I’ll reply shortly when I’m on my computer with more specific information

But if you search the project for RaymarchTemplate.shader (IIRC) you’ll see all the include files that are used in the final assembled raymarching shader (and therefore available to all snippets).

apologies about the slow reply by the way! Just realized I wasn’t getting email notifications about new topics :)