Implementing a Texture

From LuxCoreRender Wiki
Jump to navigation Jump to search

C++ Code

Files that need to be created:

  • Header: include/slg/textures/yourtexturename.h
  • Source: src/slg/textures/yourtexturename.cpp

Files that need to be edited:

  • Base texture header: include/slg/textures/texture.h
  • Sceneparse: src/slg/scene/parsetextures.cpp
  • CMakeLists.txt: src/slg/CMakeLists.txt

Commit with example: adding the "Divide" texture: https://github.com/LuxCoreRender/LuxCore/commit/ce6e23c244b1bb426c1dcd13099a41982e565b88

Modifying the base texture header

Open the file include/slg/textures/texture.h Add your new texture type to the TextureType enum.

Modifying Sceneparse

TODO

Modifying CMakeLists.txt

TODO

Compile and Test

To test your plugin, compile LuxCore: Compiling_LuxCore

After the compilation succeeds, you will need a scene to test your plugin. The easiest method is to edit one of the .scn files in the scenes/luxball directory.

TODO Example

Now, run luxcoreui from the root LuxCore directory with

./bin/luxcoreui ./scenes/luxball/luxball-sunset.cfg

TODO result example image

OpenCL Code

TODO