Godot Version
4.6.2
Question
I want to add some functions of BaseMaterial3D to my own shader like triplanar, how can i get the source code?
The godot source code is a good place to start I would imagine.
/**************************************************************************/
/* material.cpp */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
This file has been truncated. show original
mrcdk
June 30, 2026, 6:27am
4
You can convert the material to a ShaderMaterial by right-clicking over it and clicking on Convert to ShaderMaterial You’ll be able to see the shader code this way.