Shader Pack and Material Tutorial

From Custom Mario Kart
Jump to navigation Jump to search
Shader Pack and Material Tutorial
Author: JimmyKaz
Version: v2.0
Date of latest version: 2022-05-29
Download: Discord

Overview

The Shader Pack and Material Tutorial (also known as Shader Starter Pack) is a collection of BRRES shaders created by JimmyKaz. The author has created various shaders for use within custom tracks and models for other games that use BRRES models. This pack was created over the course of four months. The author had to spend a large amount of time studying the various effects of each setting. They were tested on models with Dolphin and NoClip.

Texture Mapping Types

TexCoord

Using this mapping type will place textures in relation to how they were placed on the model (within the modeling software it was created in). The textures will stay in the same place in the model, even if the player moves.

Projection

Projection mapping is commonly used with environment textures. Using this will cause the projection textures in the material to move around with the player as they move around within the model.

Shader Settings

This part of the page assumes you have just created a new shader; that is the basis for which these settings will be described for. The minimum settings needed for textures to show up upon creating a new shader are the following:

'''aTev Fragment Sources'''
* Texture Enabled = True
* Texture Map ID = TexMap0
* Texture Coordinates ID = TexCoord0

'''bTEV Color Output'''
* Selection A = TextureColor
* Scale = MultiplyBy1

'''cTEV Alpha Output'''
* Selection A = TextureAlpha
* Scale = MultiplyBy1

bTEV Color Output

Selection A

This setting tells the shader what to display on the material. It is highly recommended you set this to "TextureColor".

Bias

This setting has the ability to make the texture additionally darker or brighter depending on what option you set it to.

Scale

This setting controls the brightness level of the shader. Multiplying it makes it brighter and dividing makes it darker.

Destination

Leave this set to "OutputColor".

cTEV Alpha Output

Scale

When using transparent textures, sometimes elements of white and black pixels will be present. This setting allows these elements to be removed when multiplying by a high amount, or in some cases, dividing by one.

Shaders

The following shaders are included in this pack.

Phong

The default shader created by BrawlCrate. More often than not, this will cause many areas of your model to be noticeably darker than the rest.

No Phong

The default shader created by BrawlCrate only allows for certain areas of your model to have brightness (depending on the model). The other areas in it are noticeably darker by comparison; this causes problems for models such as skyboxes and spheres. This shader allows for the same exact level of brightness to be retained around all areas of the model.

Double Textures

This shader allows for the use of a secondary texture in a material, whether it be for bump maps or environment textures. To apply this shader to a skybox, see the Multi Material Skybox Shader.

Material

The material you wish to use this shader on must have two texture references. The default material options for transparency do not need to be changed, unless the textures requires it.

If the textures you are using require transparency, set the following settings in the material to this:

* Ref0 = 128
* Comp0 = GreaterOrEqual
* Logic = AND
* Ref1 = 255
* Comp1 = LessOrEqual

* EnableBlend = False
* EnableBlendLogic = False

* XLUMaterial = False

Make a duplicate of the first texture reference and change the texture to the secondary texture you wish to use.

Triple Textures

This shader allows for the use of three different textures within a material.

Material

The material you wish to use this shader on must have three texture references. The default material options for transparency do not need to be changed unless the textures require them.

If the textures you are using require transparency, set the following settings in the material to this:

* Ref0 = 128
* Comp0 = GreaterOrEqual
* Logic = AND
* Ref1 = 255
* Comp1 = LessOrEqual

* EnableBlend = False
* EnableBlendLogic = False

* XLUMaterial = False

Original Color

This shader keeps the original color of the texture used.

Multi Material Skybox

This shader allows a secondary image to be used in a skybox model.

Material

The material you wish to use this shader on must have two texture references. The default material options for transparency do not need to be changed unless the textures require them.

If the textures you are using require transparency, set the following settings in the material to this:

* Ref0 = 128
* Comp0 = GreaterOrEqual
* Logic = AND
* Ref1 = 255
* Comp1 = LessOrEqual

* EnableBlend = False
* EnableBlendLogic = False

* XLUMaterial = False

Make a duplicate of the first texture reference and change the texture to the secondary texture you wish to use.

Multi Material Skybox - Original Color

This shader allows a secondary texture to be used on a skybox model. However, this also allows the textures to keep their original colors when using it.

Swordplay Showdown Shader

In Wii Sports Resort, the game Swordplay Showdown has a unique shader that allows all three times of day (post-effects) to apply the appropriate lighting on the textures used in the model. Using other shaders often causes the game to use the same exact same lighting. This shader allows the model you load into the game to have the appropriate lighting effects for all three times of day.

Nightmare Shader

This is a shader that will amplify the contrast and saturation levels of the texture used in the material this shader is linked to.

Minimum

This shader has the minimum amount of settings required for textures in the material to show up.

Midnight

This shader applies a darkening effect to the texture, giving it a dark overlay. Changing the scale will increase the brightness of the texture with the effect applied.

Vertex Color

This shader will colorize textures to the color that is specified in the textures's material settings. It is recommended to only use this on white or gray textures.

Applying Color to Texture

In the material you wish to use this for, duplicate the first texture reference twice, then click on the first one again, on the right tab, scroll down to the "Shader Color Block" node and click on "Color 0." Then change the default color to the one you wish to use for the texture.

Glass

In BrawlCrate, with the right material settings, textures with transparent areas can be shown exactly as they would appear in the game without issue. However, that is only the case for textures that are fully opaque with transparent areas. Transparent textures with a faded visibility level (like a slightly transparent glass texture) will not work properly without very specific settings. This shader fixes that issue. It was taken from Parallel Purgatory.

Version History

Version Date of release Information
v1.0 2021-09-09 First release
v2.0 2022-05-29 Added new shaders.