OpenGL immediate mode: fix inverted normal in sphere batch
This commit is contained in:
parent
8c09fa3be2
commit
0790976b6c
|
@ -1301,7 +1301,6 @@ void ui_draw_but_UNITVEC(uiBut *but, uiWidgetColors *wcol, const rcti *rect)
|
|||
|
||||
/* setup lights */
|
||||
ui_but_v3_get(but, light);
|
||||
light[2] = -light[2];
|
||||
|
||||
/* transform to button */
|
||||
gpuMatrixBegin3D_legacy();
|
||||
|
|
|
@ -78,15 +78,15 @@ static Batch *batch_sphere(int lat_res, int lon_res)
|
|||
lat = 0.0f;
|
||||
for(int j = 0; j < lat_res; j++, lat += lat_inc) {
|
||||
if (j != lat_res - 1) { /* Pole */
|
||||
batch_sphere_lat_lon_vert(lat, lon);
|
||||
batch_sphere_lat_lon_vert(lat+lat_inc, lon);
|
||||
batch_sphere_lat_lon_vert(lat+lat_inc, lon+lon_inc);
|
||||
batch_sphere_lat_lon_vert(lat+lat_inc, lon);
|
||||
batch_sphere_lat_lon_vert(lat, lon);
|
||||
}
|
||||
|
||||
if (j != 0) { /* Pole */
|
||||
batch_sphere_lat_lon_vert(lat, lon);
|
||||
batch_sphere_lat_lon_vert(lat+lat_inc, lon+lon_inc);
|
||||
batch_sphere_lat_lon_vert(lat, lon+lon_inc);
|
||||
batch_sphere_lat_lon_vert(lat+lat_inc, lon+lon_inc);
|
||||
batch_sphere_lat_lon_vert(lat, lon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ Batch *Batch_get_sphere(int lod)
|
|||
void gpu_batch_init(void)
|
||||
{
|
||||
/* Hard coded resolution */
|
||||
sphere_low = batch_sphere(8, 8);
|
||||
sphere_low = batch_sphere(8, 16);
|
||||
sphere_med = batch_sphere(16, 10);
|
||||
sphere_high = batch_sphere(32, 24);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue