Skip to content
Slavinsky edited this page Jun 22, 2016 · 5 revisions

Order Of Code Blocks

It's important to keep track of the order of the code blocks in cases of shaders and instances because the scene file parser reads these code blocks in order. If the order of the blocks isn't right, for example an object with a certain shader is read before the shader block, the object won't get the shader because when Sunflow read the object's shader it didn't know that shader since it hadn't seen it yet. Similarly with instances, the object needs to be read first before the instance of that object is defined. Here's the order we suggest:

Include

You can include other .sc files to be used along with your orignal scene file by adding the following line to the original scene file:

include myOtherScene.sc

This helps when you have some big files that are hard to manage (mesh files) or if you have scene settings that you know eill always be constant and you don't want to accidentally change

Commenting Out Lines

If you want to not have something in your scene to work or show up you can always comment out sections of the scene file rather than delete blocks of code

There are 2 ways to do this in the scene file:

%Comment out a single line with a "%" sign.

/* Comment out a single line
or many lines
with a "/*" and "*/"
at the beginning and end
of your code */

Clone this wiki locally