welcome to linkAR technical documentation

next

previous

HOW TO USE .CFG FILES

WHAT ARE .CFG FILES

A .cfg file, is a configuration file. It's used in the Engine for adding and setting up several features to materials and textures. It's just a text file including simple pieces of code that allows us to activate and change that features. They are almost always placed near to the textures with the same name.

TYPES OF CFG FILES

There are mainly two types of .cfg files: material and reflections. Let's take a look at each one of them and how to use them.

MATERIAL CFG FILES

These files allow us to setup texture's parameters. Mainly they're used to use transparent textures. Here is the content of a standard .cfg file:

[TextureConfiguration]
Blend= 1
BlendOp0= BLEND_SRC_ALPHA
BlendOp1= BLEND_ONE_MINUS_SRC_ALPHA
AlphaTest= 0
AlphaFunc= LOWER
AlphaRefValue= 1.0

These lines define how the texture blends with other textures behind it, and how the alpha channel is being drawn in the Engine. Let's take it by parts, and explain the effect these parameter have.

First, the blending options:

[TextureConfiguration]
Blend= 1
BlendOp0= BLEND_SRC_ALPHA
BlendOp1= BLEND_ONE_MINUS_SRC_ALPHA

The first line, “Blend= 1”, defines if we're using blending or not. Use 1 to activate, and 0 to deactivate (this would have the same effect as not having a .cfg file). next

previous