Reality Display Processor/Commands: Difference between revisions

Set Environment/Primitive/Blend/Fog/Fill Color
(Set Environment/Primitive/Blend/Fog/Fill Color)
Line 805:
}}
 
====<span style="display:none;">0x37 - Set_Fill_ColorSet Fill Color ====
----
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! colspan="17"|Set_Fill_ColorSet Fill Color <code>0x37</code>
|-
| 63:48 || — || — || colspan=6| command = 0x37[5:0] || — || — || — || — || — || — || — || —
Line 814:
| 47:32 || — || — || — || — || — || — || — || — || — || — || — || — || — || — || — || —
|-
| 31:16 || colspan=16| set.fill.color[31:16]
|-
| 15:0 || colspan=16| set.fill.color[15:0]
|}
{{#invoke:Register table|definitions
| 61:56 | command[5:0] | 0x37
| 31:0 | set.fill.color[31:0] | -Fill Color. Format varies based on color image pixel size, see below
}}
 
Sets the fill color register, the color to use when rendering primitives in FILL mode. This is the only color sampled by FILL mode as all other pipeline stages are bypassed. This color is not made available to the Color Combiner or the Blender, and Fill Rectangle outside of FILL mode does not use it.
====<span style="display:none;">0x38 - Set_Fog_Color ====
 
Since FILL mode simply repeats the 32-bit value verbatim out to memory, proper usage of the color parameter will depend on the color image configuration:
* 32-bit: A single RGBA32 color occupying all 32 bits.
* 16-bit: Two RGBA16 colors occupying the upper and lower 16 bits respectively. Even pixels sample the upper half and odd pixels sample the lower half. For filling the color image with a solid color, simply let the upper and lower halves hold the same value.
* 8-bit: Four 8-bit intensity values, repeating every four pixels.
* 4-bit: N/A, crash
 
'''Hazards'''
* This is an attribute-setting command that requires pipeline synchronization before use, otherwise currently rendering primitives may be partially rendered using both the old fill color and the new fill color, if it was used.
 
====<span style="display:none;">0x38 - Set_Fog_ColorSet Fog Color ====
----
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! colspan="17"|Set_Fog_ColorSet Fog Color <code>0x38</code>
|-
| 63:48 || — || — || colspan=6| command = 0x38[5:0] || — || — || — || — || — || — || — || —
Line 832 ⟶ 843:
| 47:32 || — || — || — || — || — || — || — || — || — || — || — || — || — || — || — || —
|-
| 31:16 || colspan=8| fog.red[7:0] || colspan=8| fog.green[7:0]
|-
| 15:0 || colspan=8| fog.blue[7:0] || colspan=8| fog.alpha[7:0]
|}
{{#invoke:Register table|definitions
| 61:56 | command[5:0] | 0x380x39
| 31:24 | fog.red[7:0] | -Fog Red Value
| 23:16 | fog.green[7:0] | -Fog Green Value
| 15:8 | fog.blue[7:0] | -Fog Blue Value
| 7:0 | fog.alpha[7:0] | -Fog Alpha Value
}}
 
Sets the "Fog" color register to the provided RGBA value. This color is accessible from the Blender as an input.
====<span style="display:none;">0x39 - Set_Blend_Color ====
 
The name "Fog" reflects only one particular usage of how the color may be used, the name does not relate to any particular meaning in the hardware.
 
'''Hazards'''
* This is an attribute-setting command that requires pipeline synchronization before use, otherwise currently rendering primitives may be partially rendered using both the old fog color and the new fog color, if it was used.
 
====<span style="display:none;">0x39 - Set_Blend_ColorSet Blend Color ====
----
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! colspan="17"|Set_Blend_ColorSet Blend Color <code>0x39</code>
|-
| 63:48 || — || — || colspan=6| command = 0x39[5:0] || — || — || — || — || — || — || — || —
Line 853 ⟶ 871:
| 47:32 || — || — || — || — || — || — || — || — || — || — || — || — || — || — || — || —
|-
| 31:16 || colspan=8| blend.red[7:0] || colspan=8| blend.green[7:0]
|-
| 15:0 || colspan=8| blend.blue[7:0] || colspan=8| blend.alpha[7:0]
|}
{{#invoke:Register table|definitions
| 61:56 | command[5:0] | 0x39
| 31:24 | blend.red[7:0] | -Blend Red Value
| 23:16 | blend.green[7:0] | -Blend Green Value
| 15:8 | blend.blue[7:0] | -Blend Blue Value
| 7:0 | blend.alpha[7:0] | -Blend Alpha Value
}}
 
Sets the "Blend" color register to the provided RGBA value. This color is accessible from the Blender as an input.
====<span style="display:none;">0x3a - Set_Primitive_Color ====
 
The name "Blend" reflects only one particular usage of how the color may be used, the name does not relate to any particular meaning in the hardware.
 
'''Hazards'''
* This is an attribute-setting command that requires pipeline synchronization before use, otherwise currently rendering primitives may be partially rendered using both the old blend color and the new blend color, if it was used.
 
====<span style="display:none;">0x3a - Set_Primitive_ColorSet Primitive Color ====
----
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! colspan="17"|Set_Primitive_ColorSet Primitive Color <code>0x3a</code>
|-
| 63:48 || — || — || colspan=6| command = 0x3a[5:0] || — || — || — || — || — || — || — || —
|-
| 47:32 || — || — || — || — || colspan=4| primitive.minimummin_level[3:0] || colspan=8| primitive.fractionprim_lod_frac[7:0]
|-
| 31:16 || colspan=8| primitive.red[7:0] || colspan=8| primitive.green[7:0]
|-
| 15:0 || colspan=8| primitive.blue[7:0] || colspan=8| primitive.alpha[7:0]
|}
{{#invoke:Register table|definitions
| 61:56 | command[5:0] | 0x3a
| 43:40 | primitive.minimummin_level[3:0] | -Minimum LOD level
| 39:32 | primitive.fractionprim_lod_frac[7:0] | -Primitive LOD Fraction Color Combiner input
| 31:24 | primitive.red[7:0] | -Primitive Red Value
| 23:16 | primitive.green[7:0] | -Primitive Green Value
| 15:8 | primitive.blue[7:0] | -Primitive Blue Value
| 7:0 | primitive.alpha[7:0] | -Primitive Alpha Value
}}
 
Sets the "Primitive" color register to the provided RGBA value, and some LOD parameters. The color is accessible from the Color Combiner as an input.
====<span style="display:none;">0x3b - Set_Environment_Color ====
 
The name "Primitive" reflects only one particular usage of how the color may be used, the name does not relate to any particular meaning in the hardware.
 
'''prim_lod_frac''' is simply another Color Combiner input, despite the name it is not used by the texture LOD hardware feature. It may be used as a fixed interpolation factor.
 
'''min_level''' is used in the texture LOD hardware, it bounds the LOD tile selection from below. The LOD value selecting a particular tile '''N''' can be computed by
 
<math>L = 32 \cdot 2^{(N - T_{\mathrm{base}})}</math>
 
where '''T<sub>base</sub>''' is the tile number set in the triangle command. For texture rectangles this is tile 0.
 
If the LOD computed for a particular pixel during texture sampling is less than the minimum LOD level, tile 0 is used. Detail and sharpen modes may still apply. (TODO link to more detailed Texture LOD article)
 
Unlike the majority of other attribute-setters, primitive color operates correctly even in the absence of pipeline synchronizations. The primitive color may be changed between primitive rendering without corrupting prior primitives.
 
====<span style="display:none;">0x3b - Set_Environment_ColorSet Environment Color ====
----
{| class="wikitable" style="text-align: center; white-space:nowrap;"
! colspan="17"|Set_Environment_ColorSet Environment Color <code>0x3b</code>
|-
| 63:48 || — || — || colspan=6| command = 0x3b[5:0] || — || — || — || — || — || — || — || —
Line 897 ⟶ 938:
| 47:32 || — || — || — || — || — || — || — || — || — || — || — || — || — || — || — || —
|-
| 31:16 || colspan=8| environment.red[7:0] || colspan=8| environment.green[7:0]
|-
| 15:0 || colspan=8| environment.blue[7:0] || colspan=8| environment.alpha[7:0]
|}
{{#invoke:Register table|definitions
| 61:56 | command[5:0] | 0x3b
| 31:24 | environment.red[7:0] | -Environment Red value
| 23:16 | environment.green[7:0] | -Environment Green value
| 15:8 | environment.blue[7:0] | -Environment Blue value
| 7:0 | environment.alpha[7:0] | -Environment Alpha value
}}
 
Sets the "Environment" color register to the provided RGBA value. This color is accessible from the Color Combiner as an input.
 
The name "Environment" reflects only one particular usage of how the color may be used, the name does not relate to any particular meaning in the hardware.
 
'''Hazards'''
* This is an attribute-setting command that requires pipeline synchronization before use, otherwise currently rendering primitives may be partially rendered using both the old environment color and the new environment color, if it was used.
 
====<span style="display:none;">0x3c - Set_Combine_Mode ====
56

edits