[Orxonox-commit 7604] r12197 - in code/branches/mergeFS18: . data/levels src/libraries/tools

merholzl at orxonox.net merholzl at orxonox.net
Thu Feb 28 14:30:40 CET 2019


Author: merholzl
Date: 2019-02-28 14:30:40 +0100 (Thu, 28 Feb 2019)
New Revision: 12197

Added:
   code/branches/mergeFS18/data/levels/BumpMap.oxw
Removed:
   code/branches/mergeFS18/data/levels/kart_alpha0.1.oxw
Modified:
   code/branches/mergeFS18/
   code/branches/mergeFS18/data/levels/tutorial.oxw
   code/branches/mergeFS18/src/libraries/tools/Mesh.cc
Log:
Shader merge

Index: code/branches/mergeFS18
===================================================================
--- code/branches/mergeFS18	2019-02-28 12:06:00 UTC (rev 12196)
+++ code/branches/mergeFS18	2019-02-28 13:30:40 UTC (rev 12197)

Property changes on: code/branches/mergeFS18
___________________________________________________________________
Modified: svn:mergeinfo
## -169,6 +169,7 ##
 /code/branches/rocket2:6953-6970
 /code/branches/script_trigger:1295-1953,1955
 /code/branches/sfxThilo:9691-9917
+/code/branches/shader_HS18:12034-12196
 /code/branches/shaders:9379-11072
 /code/branches/shaders_merge:11072-11079
 /code/branches/shipSelection:9038-9206
Copied: code/branches/mergeFS18/data/levels/BumpMap.oxw (from rev 12196, code/branches/shader_HS18/data/levels/BumpMap.oxw)
===================================================================
--- code/branches/mergeFS18/data/levels/BumpMap.oxw	                        (rev 0)
+++ code/branches/mergeFS18/data/levels/BumpMap.oxw	2019-02-28 13:30:40 UTC (rev 12197)
@@ -0,0 +1,82 @@
+<!-- Author: Philip Wiese <wiesep at student.ethz.ch> -->
+<LevelInfo
+ name = "BumpMap"
+ description = "A demonstration of bump maps (created HS18)"
+ tags = "test, showcase"
+ screenshot = "bumpMap.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipEscort.oxt")
+?>
+
+<Level>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.5, 0.5, 0.5"
+    skybox       = "Orxonox/Starbox"
+  >
+
+
+  <!--
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+  -->
+
+    <Light type=point position="100,30,300" lookat="0,0,0" diffuse="0.8, 0.8, 0.8, 1.0" specular="0.5, 0.9, 0.9, 1.0"/>
+    <Model position="100,30,200" mesh="rocket.mesh" scale="3" lookat="0,0,0"/>
+
+    <Light type=point position="-20,-30,-200" lookat="0,0,0" diffuse="0.8, 0.8, 0.8, 1.0" specular="0.5, 0.5, 0.5, 1.0"/>
+    <Model position="-20,-30,-200" mesh="rocket.mesh" scale="3" lookat="0,0,0"/>
+    
+    <Light type=point position="20,200,20" lookat="0,0,0" diffuse="0.3, 0.3, 0.3, 1.0" specular="0.5, 0.5, 0.5, 1.0"/>
+    <Model position="20,200,20" mesh="rocket.mesh" scale="3" lookat="0,0,0"/>
+<!--
+    <Light type=point position="100,200,0" lookat="0,0,0" diffuse="0.8, 0.7, 0.7, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <Model position="100,200,0" mesh="Coordinates.mesh" scale="3" lookat="0,0,0"/>
+
+    <Light type=point position="20,-200,0" lookat="0,0,0" diffuse="0.8, 0.7, 0.7, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <Model position="20,-200,0" mesh="Coordinates.mesh" scale="3" lookat="0,0,0"/>
+
+    <Light type=point position="200,0,0" lookat="0,0,0" diffuse="0.8, 0.7, 0.7, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <Model position="200,0,0" mesh="Coordinates.mesh" scale="3" lookat="0,0,0"/>
+
+    <Light type=point position="-200,0,0" lookat="0,0,0" diffuse="0.8, 0.7, 0.7, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <Model position="-200,0,0" mesh="Coordinates.mesh" scale="3" lookat="0,0,0"/>
+-->
+    <SpawnPoint team=0 position="-80,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+    <!--<Model position="0, -50,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="Cube_Lava.mesh" />
+    <Model position="0, 0,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="Cube_Lava_Normal.mesh" />
+    <Model position="0, 12,0" yaw="90" pitch="-90" roll="0" scale="10" mesh="Cube_Lava_V2.mesh" />
+    <Model position="0, -12,0" yaw="90" pitch="-90" roll="0" scale="10" mesh="Cube_Lava_V2_Normal.mesh" />
+    -->
+
+    <MovableEntity position="0,0,40" rotationrate="30" rotationaxis="1,0,1">
+      <attached>
+          <Model position="0, 0,0" roll="45" scale="10" mesh="Cube_Lava.mesh" />
+      </attached>
+    </MovableEntity>
+
+    <MovableEntity position="0,0,0" rotationrate="30" rotationaxis="1,0,1">
+      <attached>
+          <Model position="0, 0,0" roll="45" scale="10" mesh="Cube_Lava_Normal.mesh" />
+      </attached>
+    </MovableEntity>
+    <MovableEntity position="0,0,-40" rotationrate="30" rotationaxis="1,0,1">
+      <attached>
+          <Model position="0, 0,0" roll="45" scale="10" mesh="Cube_Lava_Normal_Blank.mesh" />
+      </attached>
+    </MovableEntity>
+
+  </Scene>
+</Level>

Deleted: code/branches/mergeFS18/data/levels/kart_alpha0.1.oxw
===================================================================
--- code/branches/mergeFS18/data/levels/kart_alpha0.1.oxw	2019-02-28 12:06:00 UTC (rev 12196)
+++ code/branches/mergeFS18/data/levels/kart_alpha0.1.oxw	2019-02-28 13:30:40 UTC (rev 12197)
@@ -1,83 +0,0 @@
-<LevelInfo
- name = "kart_controlls"
- description = "Level for Minigame Hover"
- tags = "minigame"
- screenshot = "emptylevel.png"
-/>
-
-<?lua
-  include("stats.oxo")
-  include("HUDTemplates3.oxo")
-  include("templates/lodInformation.oxt")
-?>
-
-<?lua
-  include("templates/spaceshipPirate.oxt")
-  include("templates/spaceshipHover.oxt")
-  include("overlays/HoverHUD.oxo")
-?>
-
-<?lua
-MAZE_NUM_CELLS = 10
-MAZE_CELL_SIZE = 100
-MAZE_CELL_HEIGHT = 30
-MAZE_SIZE = MAZE_NUM_CELLS*MAZE_CELL_SIZE
-?>
-
-<Level
-plugins = hover
-gametype = Hover
->
-  <templates>
-    <Template link=lodtemplate_default />
-  </templates>
-  <?lua include("includes/notifications.oxi") ?>
-
-
-  <Scene
-    ambientlight = "0.8, 0.8, 0.8"
-    skybox       = "Orxonox/Starbox"
-    gravity      = "0, -200, 0"
-  >
-
-    <StaticEntity position="0,0,0" collisionType="static">
-      <attached>
-        <HoverOrigin
-          numCells="<?lua print(MAZE_NUM_CELLS)?>"
-          cellSize="<?lua print(MAZE_CELL_SIZE)?>"
-          cellHeight="<?lua print(MAZE_CELL_HEIGHT)?>"
-        />
-        <Model
-          position="<?lua print(MAZE_SIZE/2)?>,-16,<?lua print(MAZE_SIZE/2)?>"
-          scale3D="<?lua print(MAZE_SIZE/2)?>,16,<?lua print(MAZE_SIZE/2)?>"
-          mesh="CubeGround.mesh"
-        />
-      </attached> 
-      <collisionShapes>
-        
-        <BoxCollisionShape
-          position="<?lua print(MAZE_SIZE/2)?>,-1,<?lua print(MAZE_SIZE/2)?>"
-          halfExtents="<?lua print(MAZE_SIZE/2)?>,1,<?lua print(MAZE_SIZE/2)?>"
-        />
-      </collisionShapes>
-    </StaticEntity>
-
-    <Light
-      type=directional
-      position="-50,500,-50"
-      direction="0.577, -0.577, 0.577"
-      diffuse="1.0, 0.9, 0.9, 1.0"
-      specular="1.0, 0.9, 0.9, 1.0"
-    />
-    
-    <SpawnPoint
-      team=0
-      position="50,20,50"
-      lookat="100,20,100"
-      spawnclass=HoverShip
-      pawndesign=spaceshiphover
-    />
-    
-  </Scene>
-</Level>
-

Modified: code/branches/mergeFS18/data/levels/tutorial.oxw
===================================================================
--- code/branches/mergeFS18/data/levels/tutorial.oxw	2019-02-28 12:06:00 UTC (rev 12196)
+++ code/branches/mergeFS18/data/levels/tutorial.oxw	2019-02-28 13:30:40 UTC (rev 12197)
@@ -54,10 +54,10 @@
       <SpawnPoint position="<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=shipselection />
     <?lua end ?>
 
-    <GlobalShader compositor="Bloom" visible=false>
+    <GlobalShader compositor="Bloom" visible=true>
       <events>
         <visibility>
-          <DistanceTrigger position="0,0,0" distance=30 target="Spectator" switch=true />
+          <DistanceTrigger position="0,0,0" distance=300 target="Spectator" switch=false />
         </visibility>
       </events>
     </GlobalShader>

Modified: code/branches/mergeFS18/src/libraries/tools/Mesh.cc
===================================================================
--- code/branches/mergeFS18/src/libraries/tools/Mesh.cc	2019-02-28 12:06:00 UTC (rev 12196)
+++ code/branches/mergeFS18/src/libraries/tools/Mesh.cc	2019-02-28 13:30:40 UTC (rev 12197)
@@ -34,6 +34,7 @@
 #include <OgreEntity.h>
 #include <OgreSubEntity.h>
 #include <OgreSceneManager.h>
+#include <OgreHardwareVertexBuffer.h>
 
 #include "util/Convert.h"
 #include "core/GameMode.h"
@@ -63,6 +64,7 @@
         if (this->entity_)
             this->scenemanager_->destroyEntity(this->entity_);
 
+
         if (GameMode::showsGraphics())
         {
             try
@@ -69,8 +71,24 @@
             {
                 this->entity_ = this->scenemanager_->createEntity("Mesh" + multi_cast<std::string>(Mesh::meshCounter_s++), meshsource);
                 this->entity_->setCastShadows(this->bCastShadows_);
-            }
-            catch (...)
+
+
+                unsigned short src, dest;
+                try
+                {
+                    if (!this->entity_->getMesh()->suggestTangentVectorBuildParams(Ogre::VertexElementSemantic::VES_TANGENT, src, dest))
+                    {
+                        orxout() << "Generate Tanget for \"" << meshsource << '"' << endl;
+                        this->entity_->getMesh()->buildTangentVectors(Ogre::VertexElementSemantic::VES_TANGENT, src, dest);
+                        // this version cleans mirrored and rotated UVs but requires quality models
+                        // mesh->buildTangentVectors(VES_TANGENT, src, dest, true, true);
+                    }
+                } catch (...)
+                {
+                    orxout(internal_warning) << "Couldn't generat tangets for \"" << meshsource << '"' << endl;
+                }
+
+            } catch (...)
             {
                 orxout(internal_error) << "Couldn't load mesh \"" << meshsource << '"' << endl;
                 this->entity_ = nullptr;
@@ -106,7 +124,7 @@
         {
                 this->entity_->getSubEntity(index)->setMaterialName(name);
         }
-        else 
+        else
             orxout() << "ERROR at Index " << index << endl;
     }
 



More information about the Orxonox-commit mailing list