Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

The TEV Stage Manager

Super Hackio edited this page Nov 2, 2018 · 7 revisions

This is the TEV Stage Manager of SuperJSON. When opened, the Main Menu is not visible.

TEV Stands for Texture EnVironment

Features List

  1. Setting up
  2. Texture Environment Unit
  3. Managing the Stages
  4. TEV Stage Settings

Setting Up

SuperJSON is nice and will automatically load all the TEV Stages into a selection menu located at the top of the manager.
Most of the time, you won't really need to be editing these, but should you add a texture, these will need to be configured accordingly. This section of the Wiki will talk about how TEV Works so you can better understand what you are editing.

Note: SuperJSON will automatically create basic settings for the first TEV Stage if you add a new texture as the "first texture" (by removing all the texture in the material and then adding one again), so there's nothing much for you to worry about unless you're going advanced

Texture Environment Unit

TEV stands for Texture Environment Unit. TEV is a rendering engine that uses Input Sources to determine the final colour of a pixel. Many special effects can be achieved using TEV Stages.

How it Works

Math - and lots of it!
The TEV works with a stage system ranging from one stage (Stage 0) to sixteen stages (Stage 15) enabling lots of effects to be achieved. Every stage has the same options for you to set, but depending on what stage number you're editing, these settings may change!

Managing the stages

The TEV Stage Manager allows you to edit all 16 TEV Stages available to your disposal. You can switch TEV Stages by clicking the TEV Stage at the top of the Manager

Adding TEV Stages

It's as easy as choosing a TEV Stage marked with (Empty) in the TEV Stage selector.

Note: Default settings will be applied to the new TEV Stage

Removing TEV Stages

Pressing the Delete Button will clear out the selected TEV Stage and shift the TEV Stages above it down

Note: Deleted TEV Stages cannot be recovered, so be careful!

TEV Stage Settings

For each TEV Stage in the TEV Stage list (Haha programming reference) there are 18 options. Yes, 18 different options. Nine options are for Colour, while the other nine are for Alpha.

Colour Settings

Colour Inputs

There are four Colour Inputs simply labeled with Letters: A | B | C | D
SuperJSON calls these: Colour In A | Colour In B | Colour In C | Colour In D
These four Inputs have the same options available to use.

  • ColorPrev
    • Use the previous stage's colour
  • AlphaPrev
    • Use the previous stage's Alpha
  • C[0-2]
    • Use a Colour Register (Ranges from 0-2)
  • A[0-2]
    • Use an Alpha Register (Ranges from 0-2)
  • TexColor
    • Use the Texture's colour channels
  • TexAlpha
    • Use the Texture's Alpha channels
  • RasColour
    • Use the Rasterized Colour
  • RasAlpha
    • Use the Rasterized Alpha
  • One
    • Use 1
  • Half
    • Use 0.5
  • Konst
    • Use a Konst Colour
  • Zero
    • Use 0

Note: Using Zero means the Input has nothing in it - if all inputs are set to Zero, the image will appear black in-game

Colour Operator

The Colour Operator (ColourOP in SuperJSON) has plenty of options to choose from. Here is what they mean:

  • Add
    • Colour In d + (Colour In a + (Colour In b * Colour In c))
  • Sub
    • Colour In d - (Colour In a + (Colour In b * Colour In c))
  • Comp_R8_GT
    • Compare the RED channels in Colour In A & Colour In B to see if A > B
  • Comp_R8_EQ
    • Compare the RED channels in Colour In A & Colour In B to see if A = B
  • Comp_GR16_GT
    • Compare the GREEN & RED channels in Colour In A & Colour In B to see if A > B
  • Comp_GR16_EQ
    • Compare the GREEN & RED channels in Colour In A & Colour In B to see if A = B
  • Comp_BGR24_GT
    • Compare the BLUE, GREEN & RED channels in Colour In A & Colour In B to see if A > B
  • Comp_BGR24_EQ
    • Compare the BLUE, GREEN & RED channels in Colour In A & Colour In B to see if A = B
  • Comp_RGB8_GT
    • Compare the RED, GREEN & BLUE channels in Colour In A & Colour In B individually to see if A > B
  • Comp_RGB8_EQ
    • Compare the RED, GREEN & BLUE channels in Colour In A & Colour In B individually to see if A = B

Note: If you choose one of the compare options, the ColourBias & ColourScale have to be a certain value, SuperJSON will take care of this for you automatically

Colour Bias

The ColourBias option is a small multiplier of sorts. It doesn't have a large effect, as the values are -0.5 | 0.0 | +0.5.
Most of the time, just using zero will work.

  • AddHalf
    • Multiplies the colour achieved from 1 - C x A + C x B by +0.5
  • SubHalf
    • Divides the colour achieved from from 1 - C x A + C x B in half
  • Zero
    • Don't change anything

Colour Scale

This value will multiply the entire result before moving on to the next TEV Stage

  • Scale_1
    • Multiply the result by 1.0 (Change nothing)
  • Scale_2
    • Multiply the result by 2.0 (Double result)
  • Scale_4
    • Multiply the result by 4.0 (Quadruple result)
  • Divide_2
    • Divide the result by 0.5 (Cut result in half)

Colour Register ID

This is the channel the result is put into. There are 3 total and can be accessed using C[0-2] OR ColorPrev Input options.

  • TevPrev
    • The Final output channel (ColorPrev)
  • TevReg0
    • The First output channel (C0)
  • TevReg1
    • The Second output channel (C1)
  • TevReg2
    • The Third output channel (C2)

Colour Clamp

Clamps the output to a value between 0 and 255

Alpha Settings

Alpha Inputs

There are four Alpha Inputs simply labeled with Letters: A | B | C | D
SuperJSON calls these: Alpha In A | Alpha In B | Alpha In C | Alpha In D
These four Inputs have the same options available to use.

  • ColorPrev
    • Use the previous stage's colour
  • AlphaPrev
    • Use the previous stage's Alpha
  • C[0-2]
    • Use a Colour Register (Ranges from 0-2)
  • A[0-2]
    • Use an Alpha Register (Ranges from 0-2)
  • TexColor
    • Use the Texture's colour channels
  • TexAlpha
    • Use the Texture's Alpha channels
  • RasColour
    • Use the Rasterized Colour
  • RasAlpha
    • Use the Rasterized Alpha
  • One
    • Use 1
  • Half
    • Use 0.5
  • Konst
    • Use a Konst Colour
  • Zero
    • Use 0

Note: Using Zero means the Input has nothing in it - if all inputs are set to Zero, the image will appear black in-game

Alpha Operator

The Alpha Operator (AlphaOP in SuperJSON) has only a couple of options to choose from. Here is what they mean:

  • Add
    • Alpha In d + (Alpha In a + (Alpha In b * Alpha In c))
  • Sub
    • Alpha In d - (Alpha In a + (Alpha In b * Alpha In c))
  • Comp_A8_GT
    • Compare the ALPHA channels in Alpha In A & Alpha In B to see if A > B
  • Comp_A8_EQ
    • Compare the ALPHA channels in Alpha In A & Alpha In B to see if A = B

Note: If you choose one of the compare options, the AlphaBias & AlphaScale have to be a certain value, SuperJSON will take care of this for you automatically

Alpha Bias

The AlphaBias option is a small multiplier of sorts. It doesn't have a large effect, as the values are -0.5 | 0.0 | +0.5.
Most of the time, just using zero will work.

  • AddHalf
    • Multiplies the colour achieved from 1 - C x A + C x B by +0.5
  • SubHalf
    • Divides the colour achieved from from 1 - C x A + C x B in half
  • Zero
    • Don't change anything

Alpha Scale

This value will multiply the entire result before moving on to the next TEV Stage

  • Scale_1
    • Multiply the result by 1.0 (Change nothing)
  • Scale_2
    • Multiply the result by 2.0 (Double result)
  • Scale_4
    • Multiply the result by 4.0 (Quadruple result)
  • Divide_2
    • Divide the result by 0.5 (Cut result in half)

Alpha Register ID

This is the channel the result is put into. There are 3 total and can be accessed using A[0-2] OR AlphaPrev Input options.

  • TevPrev
    • The Final output channel (AlphaPrev)
  • TevReg0
    • The First output channel (A0)
  • TevReg1
    • The Second output channel (A1)
  • TevReg2
    • The Third output channel (A2)

Alpha Clamp

Clamps the output to a value between 0 and 255