Functions
init-cloud-vert-array() => symbolsource
init-haze-vert-array() => symbolsource
sky-make-moon-data(arg0: sky-work, arg1: float) => nonesource
Initialize upload-data
with sky-moon-data in sky-work
sky-make-sun-data(arg0: sky-work, arg1: int, arg2: float) => nonesource
Initialize upload-data
with sky-sun-data in sky-work
Variables
*cloud-poly*: inline-arraysource
*haze-poly*: inline-arraysource
sky-base-polygons: inline-arraysource
const sky-roof-polygons: inline-arraysource
Types
cloud-lights: structuresource
cloud-vert-array: structuresource
Fields
data: cloud-vertex
cloud-vertex: structuresource
haze-lights: structuresource
haze-vert-array: structuresource
Fields
data: haze-vertex
sky-color-day: structuresource
Fields
hour: sky-color-hour
sky-color-hour: structuresource
sky-orbit: structuresource
sky-sun-data: structuresource
sky-upload-data: structuresource
sky-work: structuresource
Fields
adgif-tmpl: dma-gif-packet
draw-tmpl: dma-gif-packet
draw-tmpl2: dma-gif-packet
fog-tmpl: dma-gif-packet
blend-tmpl: dma-gif-packet
sprite-tmpl: dma-gif-packet
sprite-tmpl2: dma-gif-packet
sun-coords: vector
green-coords: vector
moon0-coords: vector
moon1-coords: vector
moon2-coords: vector
star-coords: vector
sun-colors: vector4w
green-colors: vector4w
moon-colors: vector4w
star-colors: vector4w
st-coords: vector
random: vector4w
giftag-base: dma-gif
giftag-haze: dma-gif
giftag-roof: dma-gif
giftag-ocean: dma-gif
fog: vector
sky: float
time: float
off-s: uint16
off-t: uint16
orbit: sky-orbit
upload-data: sky-upload-data
ambi-color: vector4w
ambi-color-lower: vector4w
sun0-color: vector4w
sun1-color: vector4w
moon-color: vector4w
sun0-color-lower: vector4w
cam-mat: matrix
star-mat: matrix
vec0: vector4w
vec1: vector4w
cloud-lights: cloud-lights
haze-lights: haze-lights
buf: dma-buffer
draw-vortex: basic
stars: vector
Methods
init-sun-data!(obj: sky-work, arg0: int, arg1: float, arg2: float, arg3: float) => nonesource
Sets the sun related upload data - the sun, halo and aurora
init-orbit-settings!(obj: sky-work, arg0: int, arg1: float, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float) => nonesource
update-colors-for-time(obj: sky-work, arg0: float) => nonesource
Update sky colors for the given time.
update-time-and-speed(obj: sky-work, arg0: float, arg1: float) => nonesource
Update based on the given time. Time is used to place suns/moon at the right spot, speed is used to scroll clouds.
update-matrix(obj: sky-work, arg0: matrix) => nonesource
Update the projection matrix for sky drawing.
The input matrix should not include perepctive.
This function will apply the current math camera's perspective.
update-template-colors(obj: sky-work) => nonesource
Update skybox colors from level/mood.
init-regs-for-large-polygon-draw: unknown
init-regs-for-sky-asm: unknown
cloud-vtx-light-update(obj: sky-work, arg0: vector, arg1: vector, arg2: cloud-lights, arg3: vector, arg4: vector) => nonesource
Update lighting for cloud mesh vertex.
cloud-vtx-tex-update(obj: sky-work, arg0: vector, arg1: vector, arg2: vector, arg3: cloud-lights) => nonesource
Update texture stq for cloud mesh vertex.
adjust-cloud-lighting(obj: sky-work) => nonesource
Apply lighting to cloud vertices
cloud-vtx1-to-sky(obj: sky-work, arg0: sky-vertex, arg1: cloud-vertex) => nonesource
Convert a cloud vertex to a sky vertex, using the 'normal' stq/col
cloud-vtx2-to-sky(obj: sky-work, arg0: sky-vertex, arg1: cloud-vertex) => nonesource
Convert a cloud vertex to a sky vertex, using the '2' stq/col
draw-clouds(obj: sky-work, arg0: dma-buffer) => nonesource
Draw the cloud layer using large polygon renderer
Assumes that init-regs-for-large-polygon-draw was already called.
apply-haze-light(obj: sky-work, arg0: vector, arg1: vector, arg2: haze-lights) => nonesource
Apply haze lights to a vertex.
adjust-haze-lighting(obj: sky-work) => nonesource
Adjust lighting for haze.
haze-vtx-to-sky(obj: sky-work, arg0: sky-vertex, arg1: sky-vertex, arg2: haze-vertex) => nonesource
Convert haze vertex to sky format.
draw-haze(obj: sky-work, arg0: dma-buffer) => nonesource
Draw haze using large polygon renderer.
Calls init-regs-for-large-polygon-draw.
sun-dma: unknown
green-sun-dma: unknown
moon-dma: unknown
setup-stars(obj: sky-work, arg0: matrix, arg1: sky-upload-data) => nonesource
Prepare for star drawing.
stars-transform-asm: unknown
stars-dma: unknown
draw-roof(obj: sky-work, arg0: dma-buffer) => nonesource
Draw the roof of the sky box. Uses large-polygon renderer.
draw-base(obj: sky-work, arg0: dma-buffer) => nonesource
Draw the base of the sky box. Uses large-polygon renderer.
draw-fog(obj: sky-work, arg0: dma-buffer) => nonesource
Expand description
Sky renderer.
this render is much more complicated than the jak 1 version.
there's a lot of weird tricks to store values in the VF registers, and a lot of asm,
so a lot of this is in C++.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Large Polygon Renderer
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
there's a special "large polygon renderer" that handles clipping
and ps2-specific texture perspective stuff.
the way it subdivides is extremely strange, and not well understood, but it works well with the
Direct renderer in C++.
this renderer is also used for drawing debug regions and some parts of the ocean near the horizon.
there's a lot of state stored in vf registers, so we have to be very careful with this.
VF registers for large polygon
vf13: fog
vf14: hmge
vf23: 0?
vf24: texture offset (stored in xy, zw are 0),
vf25: hvdf-offset
vf26: inv-hmge
vf27: giftag
vf28: cam 3 (premultiplied by hmge)
vf29: cam 2 (premultiplied by hmge)
vf30: cam 1 (premultiplied by hmge)
vf31: cam 0 (premultiplied by hmge)
Functions
close-sky-buffer(arg0: dma-buffer) => nonesource
Terminate dma from large polygon renderer. This should be called after the last
call to render-sky-tri/quad.