Mercurial > hg > Game > Cerium
changeset 1393:80e96b616196 draft
fix
author | Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 30 Jan 2012 21:30:54 +0900 |
parents | e7a515fcd0fc |
children | e838c90ba498 |
files | Renderer/Engine/task/CreatePolygonFromSceneGraph.cc Renderer/Engine/viewer.cc Renderer/Test/Makefile.def Renderer/Test/create_task.cc Renderer/Test/property_chain.cc Renderer/Test/property_universe.cc TaskManager/Makefile.def |
diffstat | 7 files changed, 35 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/task/CreatePolygonFromSceneGraph.cc Thu Jan 19 22:10:47 2012 +0900 +++ b/Renderer/Engine/task/CreatePolygonFromSceneGraph.cc Mon Jan 30 21:30:54 2012 +0900 @@ -188,17 +188,19 @@ ApplyMatrix(normal3, normal_matrix); // test + for (int j = 0; j < light_num; j++) { // 光源のスイッチが入ってたら - if (light_switch[j] == 1) { + if (light_switch[j] == 1) { // 複数の光源の計算, 全部足し合わせてみる.. // rdb値は255を超えた値は、255にされるからここではいくら足してもいい diffuse1 += lighting(xyz1, normal1, &light_xyz[j*4]); diffuse2 += lighting(xyz2, normal2, &light_xyz[j*4]); diffuse3 += lighting(xyz3, normal3, &light_xyz[j*4]); - } + } } + // このif文は、視錐台カリングに変えられる. 違うやり方があるはず if (xyz1[2] > 100 && xyz2[2] > 100 && xyz3[2] > 100) {
--- a/Renderer/Engine/viewer.cc Thu Jan 19 22:10:47 2012 +0900 +++ b/Renderer/Engine/viewer.cc Mon Jan 30 21:30:54 2012 +0900 @@ -113,6 +113,18 @@ data_load->spawn(); } + HTaskPtr data_load = manager->create_task(DataAllocate); + data_load->set_param(0,(memaddr)3); // num of allocate block + data_load->set_param(1,(memaddr)(sizeof(float)*4*light_num)); // 1st allocate size + data_load->set_param(2,(memaddr)Light); // 1st id + data_load->set_param(3,(memaddr)(light_num * sizeof(int))); // 2nd size + data_load->set_param(4,(memaddr)LightSwitch); // 2nd id + data_load->set_param(5,(memaddr)16); // 3rd size + data_load->set_param(6,(memaddr)LightSysSwitch); // 3rd id + data_load->set_cpu(CPU_PPE); + data_load->spawn(); + + light_switch = (int*)manager->allocate(size); for (int i = 0; i < light_num; i++) { @@ -684,7 +696,7 @@ light_sysswitch[0] = light_sysswitch_stock; -#if 1 +#if 0 HTask *data_update_wait = 0; for (int i = 0; i < spe_num; i++) { @@ -710,10 +722,21 @@ data_update->set_inData(1,light_switch,light_num * sizeof(int)); // LightSwitch = Light+1 data_update->set_inData(2,light_sysswitch,16); // LightSysSwitch = Light+2 data_update->set_cpu((CPU_TYPE)(SPE_0+i)); - data_update->wait_for(data_update_wait); + data_update_wait->wait_for(data_update); data_update->spawn(); } + HTaskPtr data_update = manager->create_task(DataUpdate); + data_update->set_param(0,3); + data_update->set_param(1,Light); // GlobalSet ID base + data_update->set_inData(0,light_xyz,size); // Light + data_update->set_inData(1,light_switch,light_num * sizeof(int)); // LightSwitch = Light+1 + data_update->set_inData(2,light_sysswitch,16); // LightSysSwitch = Light+2 + data_update->set_cpu(CPU_PPE); + data_update_wait->wait_for(data_update); + data_update->spawn(); + + #endif ppi ^= 1; @@ -766,7 +789,7 @@ task_draw_array->spawn_task_array(task_draw->next()); task_draw_array->set_cpu(SPE_ANY); - //task_draw_array->wait_for(data_update_wait); + task_draw_array->wait_for(data_update_wait); #ifndef USE_PIPELINE task_next->wait_for(task_draw_array); #endif @@ -822,7 +845,7 @@ } - //data_update_wait->spawn(); + data_update_wait->spawn(); spi ^= 1; for (int i = 1; i <= r[spi].spackList_length; i++) {
--- a/Renderer/Test/Makefile.def Thu Jan 19 22:10:47 2012 +0900 +++ b/Renderer/Test/Makefile.def Mon Jan 30 21:30:54 2012 +0900 @@ -4,8 +4,8 @@ ABIBIT = 64 ABI = -m$(ABIBIT) CC = g++ -CFLAGS = -Wall $(ABI) -g -# CFLAGS = -Wall $(ABI) -O9 #-g # -O -DDEBUG +#CFLAGS = -Wall $(ABI) -g +CFLAGS = -Wall $(ABI) -O9 #-g # -O -DDEBUG INCLUDE = -I$(CERIUM)/include/TaskManager -I$(CERIUM)/Renderer/Engine -I. -I$(CERIUM)/include/Cerium
--- a/Renderer/Test/create_task.cc Thu Jan 19 22:10:47 2012 +0900 +++ b/Renderer/Test/create_task.cc Mon Jan 30 21:30:54 2012 +0900 @@ -62,7 +62,6 @@ // get matrix get_matrix(node->matrix, node->angle, node->xyz, sgroot->camera->matrix); - get_matrix(node->real_matrix, node->angle, node->xyz, sgroot->camera->real_matrix); sgroot->setSceneData(node);
--- a/Renderer/Test/property_chain.cc Thu Jan 19 22:10:47 2012 +0900 +++ b/Renderer/Test/property_chain.cc Mon Jan 30 21:30:54 2012 +0900 @@ -106,10 +106,8 @@ SceneGraphPtr parent = (SceneGraphPtr)update_property[p->parent_index].node; parent->addChild(p_node); get_matrix(p_node->matrix, p_node->angle, p_node->xyz, parent->matrix); - get_matrix(p_node->real_matrix, p_node->angle, p_node->xyz, parent->real_matrix); } else { get_matrix(p_node->matrix, p_node->angle, p_node->xyz, camera->matrix); - get_matrix(p_node->real_matrix, p_node->angle, p_node->xyz, camera->real_matrix); } }
--- a/Renderer/Test/property_universe.cc Thu Jan 19 22:10:47 2012 +0900 +++ b/Renderer/Test/property_universe.cc Mon Jan 30 21:30:54 2012 +0900 @@ -67,10 +67,8 @@ SceneGraphPtr parent = (SceneGraphPtr)update_property[p->parent_index].node; parent->addChild(p_node); get_matrix(p_node->matrix, p_node->angle, p_node->xyz, parent->matrix); - get_matrix(p_node->real_matrix, p_node->angle, p_node->xyz, parent->real_matrix); } else { get_matrix(p_node->matrix, p_node->angle, p_node->xyz, camera->matrix); - get_matrix(p_node->real_matrix, p_node->angle, p_node->xyz, camera->real_matrix); } }
--- a/TaskManager/Makefile.def Thu Jan 19 22:10:47 2012 +0900 +++ b/TaskManager/Makefile.def Mon Jan 30 21:30:54 2012 +0900 @@ -29,8 +29,8 @@ ABIBIT = 64 -OPT = -g -O0 -DMAIL_QUEUE -DNOT_CHECK #-DTASK_LIST_MAIL #-DEARLY_TOUCH -DUSE_CACHE -#OPT = -O9 -DMAIL_QUEUE -DNOT_CHECK #-DTASK_LIST_MAIL #-DEARLY_TOUCH -DUSE_CACHE +#OPT = -g -O0 -DMAIL_QUEUE -DNOT_CHECK #-DTASK_LIST_MAIL #-DEARLY_TOUCH -DUSE_CACHE +OPT = -O9 -DMAIL_QUEUE -DNOT_CHECK #-DTASK_LIST_MAIL #-DEARLY_TOUCH -DUSE_CACHE