Browse Source

Adding WebTexture example

Josh Engebretson 10 years ago
parent
commit
434da7b8b5

+ 1 - 0
WebTexture/.gitignore

@@ -0,0 +1 @@
+Cache/*

+ 5 - 0
WebTexture/Resources.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "3b8e10c573f14028e458d58c982c708e",
+	"FolderImporter": {}
+}

+ 5 - 0
WebTexture/Resources/Components.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "48adfc30d1fb22c226c78ff17aa14f44",
+	"FolderImporter": {}
+}

+ 16 - 0
WebTexture/Resources/Components/Spinner.js

@@ -0,0 +1,16 @@
+
+"atomic component";
+
+var inspectorFields = {
+  speed: 1.0
+}
+
+exports.component = function(self) {
+
+  self.update = function(timeStep) {
+
+    self.node.yaw(timeStep * 75 * self.speed);
+    
+  }
+
+}

+ 7 - 0
WebTexture/Resources/Components/Spinner.js.asset

@@ -0,0 +1,7 @@
+{
+	"version": 1,
+	"guid": "59c3460f8aebaab234a8c4e64c217cd0",
+	"JavascriptImporter": {
+		"IsComponentFile": true
+	}
+}

+ 18 - 0
WebTexture/Resources/Components/WebTexture.js

@@ -0,0 +1,18 @@
+"atomic component";
+
+var webClient = new WebView.WebClient();
+var webTexture = new WebView.WebTexture2D();
+var texture2D = webTexture.texture2D;
+texture2D.filterMode = Atomic.FILTER_TRILINEAR;
+webClient.webRenderHandler = webTexture;
+webClient.createBrowser("http://www.atomicgameengine.com", 1224, 1224);
+var renderMaterial = new Atomic.Material();
+renderMaterial.setTechnique(0, Atomic.cache.getResource("Technique", "Techniques/Diff.xml"));
+renderMaterial.setTexture(Atomic.TU_DIFFUSE, texture2D);
+
+exports.component = function(self) {
+
+  var model = self.node.getComponent("StaticModel");
+  model.setMaterial(renderMaterial);
+
+}

+ 7 - 0
WebTexture/Resources/Components/WebTexture.js.asset

@@ -0,0 +1,7 @@
+{
+	"version": 1,
+	"guid": "62df18652dc61942345ecdb42ae3e91e",
+	"JavascriptImporter": {
+		"IsComponentFile": true
+	}
+}

+ 5 - 0
WebTexture/Resources/Models.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "37d5d8ec3c34ff1fd9f96aa2bb46c1cc",
+	"FolderImporter": {}
+}

BIN
WebTexture/Resources/Models/Ground.fbx


+ 9 - 0
WebTexture/Resources/Models/Ground.fbx.asset

@@ -0,0 +1,9 @@
+{
+	"version": 1,
+	"guid": "b1fc206e3887f146e471a34b31989538",
+	"ModelImporter": {
+		"scale": 0.5,
+		"importAnimations": false,
+		"animInfo": []
+	}
+}

+ 5 - 0
WebTexture/Resources/Prefabs.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "0d6de5a2b283c1549ce017bbee8746bb",
+	"FolderImporter": {}
+}

+ 5 - 0
WebTexture/Resources/Scenes.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "2d1a096e73360c0ce14057b95f1bca72",
+	"FolderImporter": {}
+}

+ 77 - 0
WebTexture/Resources/Scenes/Scene.scene

@@ -0,0 +1,77 @@
+<?xml version="1.0"?>
+<scene id="1">
+	<attribute name="Name" value="" />
+	<attribute name="Time Scale" value="1" />
+	<attribute name="Smoothing Constant" value="50" />
+	<attribute name="Snap Threshold" value="5" />
+	<attribute name="Elapsed Time" value="0" />
+	<attribute name="Next Replicated Node ID" value="373" />
+	<attribute name="Next Replicated Component ID" value="1989" />
+	<attribute name="Next Local Node ID" value="16778496" />
+	<attribute name="Next Local Component ID" value="16777216" />
+	<attribute name="Variables" />
+	<attribute name="Variable Names" value="" />
+	<component type="PhysicsWorld" id="1" />
+	<component type="Octree" id="2" />
+	<component type="DebugRenderer" id="3" />
+	<node id="2">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Zone" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Zone" id="4">
+			<attribute name="Bounding Box Min" value="-10000 -10000 -10000" />
+			<attribute name="Bounding Box Max" value="10000 10000 10000" />
+			<attribute name="Ambient Color" value="0.4 0.4 0.4 1" />
+		</component>
+	</node>
+	<node id="3">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="GlobalLight" />
+		<attribute name="Position" value="0 0 0" />
+		<attribute name="Rotation" value="0.888074 0.325058 -0.325058 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Light" id="5">
+			<attribute name="Light Type" value="Directional" />
+			<attribute name="Cast Shadows" value="true" />
+			<attribute name="CSM Splits" value="10 20 50 0" />
+			<attribute name="View Size Quantize" value="1" />
+			<attribute name="View Size Minimum" value="5" />
+			<attribute name="Depth Constant Bias" value="0.00025" />
+			<attribute name="Depth Slope Bias" value="0.001" />
+		</component>
+	</node>
+	<node id="361">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="Camera" />
+		<attribute name="Position" value="0 0 -1" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="Camera" id="1973" />
+	</node>
+	<node id="366">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="WebCube" />
+		<attribute name="Position" value="0 0 0.0370512" />
+		<attribute name="Rotation" value="1 0 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="JSComponent" id="1980">
+			<attribute name="ComponentFile" value="JSComponentFile;Components/Spinner.js" />
+		</component>
+		<component type="JSComponent" id="1981">
+			<attribute name="ComponentFile" value="JSComponentFile;Components/WebTexture.js" />
+		</component>
+		<component type="StaticModel" id="1986">
+			<attribute name="Model" value="Model;b1fc206e3887f146e471a34b31989538.mdl" />
+			<attribute name="Material" value="Material;" />
+			<attribute name="Geometry Enabled">
+				<variant type="Bool" value="true" />
+			</attribute>
+		</component>
+	</node>
+</scene>

+ 5 - 0
WebTexture/Resources/Scenes/Scene.scene.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "96e0026c47f63560efaca6c670c62b49",
+	"SceneImporter": {}
+}

+ 5 - 0
WebTexture/Resources/Scripts.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "f7686b6279b3230e12d0714a953f1828",
+	"FolderImporter": {}
+}

+ 10 - 0
WebTexture/Resources/Scripts/main.js

@@ -0,0 +1,10 @@
+// This script is the main entry point of the game
+
+var scene = Atomic.player.loadScene("Scenes/Scene.scene");
+
+// called per frame, optional
+function update(timeStep) {
+
+}
+
+exports.update = update;

+ 7 - 0
WebTexture/Resources/Scripts/main.js.asset

@@ -0,0 +1,7 @@
+{
+	"version": 1,
+	"guid": "012152b6b4724b6dc03ac4e4ecb6d1df",
+	"JavascriptImporter": {
+		"IsComponentFile": false
+	}
+}

+ 5 - 0
WebTexture/Resources/Textures.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "a936fb8a2e6e37cd77c2dc1f9127e660",
+	"FolderImporter": {}
+}

+ 49 - 0
WebTexture/Settings/Engine.json

@@ -0,0 +1,49 @@
+{
+  "desktop": {
+
+    "engine" : {
+      "workerThreads" : true,
+      "logQuiet" : false,
+      "logLevel" : 1
+    },
+
+    "graphics": {
+      "headless": false,
+      "frameLimiter" : true,
+      "flushGPU" : false,
+      "forceGL2" : false,
+      "orientations" : "LandscapeLeft LandscapeRight",
+      "vsync" : false,
+      "tripleBuffer" : false,
+      "multiSample" : 8,
+      "renderPath" : "forward",
+      "shadows" : true,
+      "lowQualityShadows" : false,
+      "materialQuality" : "high",
+      "textureQuality" : "high",
+      "textureFilterMode" : "trilinear",
+      "textureAnisotropy" : 4
+    },
+
+    "window" : {
+      "title" : "Roboman3D",
+      "fullscreen" : false,
+      "borderless" : false,
+      "resizable" : false
+    },
+
+    "sound": {
+      "enabled" : true,
+      "interpolation" : true,
+      "stereo" : true,
+      "bufferMS": 100,
+      "mixRate" : 44100
+    },
+
+    "input" : {
+      "touchEmulation" : false
+    }
+
+  }
+
+}

+ 0 - 0
WebTexture/WebTexture.atomic