Dolphin shader handler
This commit is contained in:
@@ -22,6 +22,8 @@ errorret_t shaderInitDolphin(
|
||||
|
||||
memoryZero(shader, sizeof(shaderdolphin_t));
|
||||
|
||||
shader->definition = def;
|
||||
|
||||
glm_mat4_identity(shader->view);
|
||||
glm_mat4_identity(shader->proj);
|
||||
glm_mat4_identity(shader->model);
|
||||
@@ -87,22 +89,19 @@ errorret_t shaderSetTextureDolphin(
|
||||
assertStrLenMin(name, 1, "Uniform name cannot be empty");
|
||||
|
||||
if(texture == NULL) {
|
||||
// GX_SetNumChans(0);
|
||||
GX_SetNumChans(1);
|
||||
GX_SetChanCtrl(
|
||||
GX_COLOR0A0,
|
||||
GX_DISABLE,
|
||||
GX_SRC_REG,
|
||||
GX_SRC_VTX,
|
||||
GX_SRC_REG,
|
||||
GX_LIGHTNULL,
|
||||
GX_DF_NONE,
|
||||
GX_AF_NONE
|
||||
);
|
||||
GX_SetChanAmbColor(GX_COLOR0A0, (GXColor){ 0, 0, 0, 0 });
|
||||
GX_SetChanMatColor(GX_COLOR0A0, (GXColor){ 255, 255, 255, 255 });
|
||||
GX_SetChanAmbColor(GX_COLOR0A0, (GXColor){0,0,0,0});
|
||||
|
||||
GX_SetNumTexGens(0);
|
||||
|
||||
GX_SetNumTevStages(1);
|
||||
GX_SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORDNULL, GX_TEXMAP_NULL, GX_COLOR0A0);
|
||||
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
||||
@@ -117,13 +116,13 @@ errorret_t shaderSetTextureDolphin(
|
||||
GX_LoadTexObj(&texture->texObj, GX_TEXMAP0);
|
||||
GX_SetNumChans(1);
|
||||
GX_SetChanCtrl(
|
||||
GX_COLOR0A0,// Store in color channel 0
|
||||
GX_DISABLE,// Lighting disabled
|
||||
GX_SRC_REG,// Ambient color?
|
||||
GX_SRC_VTX,// Material color?
|
||||
GX_LIGHTNULL,// Light Mask
|
||||
GX_DF_NONE,// Diffuse function
|
||||
GX_AF_NONE// Attenuation function
|
||||
GX_COLOR0A0,
|
||||
GX_DISABLE,
|
||||
GX_SRC_REG,
|
||||
GX_SRC_REG,
|
||||
GX_LIGHTNULL,
|
||||
GX_DF_NONE,
|
||||
GX_AF_NONE
|
||||
);
|
||||
|
||||
// One set of UVs
|
||||
@@ -168,7 +167,12 @@ errorret_t shaderSetColorDolphin(
|
||||
assertNotNull(name, "Uniform name must not be null");
|
||||
assertStrLenMin(name, 1, "Uniform name cannot be empty");
|
||||
|
||||
GX_SetChanMatColor(GX_COLOR0A0, (GXColor){ color.r, color.g, color.b, color.a });
|
||||
GX_SetChanMatColor(GX_COLOR0A0, (GXColor){
|
||||
color.r,
|
||||
color.g,
|
||||
color.b,
|
||||
color.a
|
||||
});
|
||||
|
||||
errorOk();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user