From 431b6fa7610e59074b4ebb3e9e712672f185b8ad Mon Sep 17 00:00:00 2001 From: hwc487 Date: Thu, 19 Jul 2012 11:44:50 -0700 Subject: Renamed Raiders material to Dark Blur, and Paris to Blue Sky. --- assets/canvas-runtime.js | 4 +- assets/descriptor.json | 6 +-- assets/images/bluesky.png | Bin 0 -> 4108 bytes assets/images/darkblur.png | Bin 0 -> 5674 bytes assets/images/paris.png | Bin 4108 -> 0 bytes assets/images/raiders.png | Bin 5674 -> 0 bytes assets/shaders/Paris.frag.glsl | 68 -------------------------- js/io/system/ninjalibrary.json | 2 +- js/lib/geom/geom-obj.js | 4 +- js/lib/rdge/materials/radial-blur-material.js | 14 +++--- js/lib/rdge/materials/water-material.js | 14 +++--- js/models/materials-model.js | 12 ++--- js/panels/Materials/materials-data.json | 18 +++---- 13 files changed, 37 insertions(+), 105 deletions(-) create mode 100644 assets/images/bluesky.png create mode 100644 assets/images/darkblur.png delete mode 100644 assets/images/paris.png delete mode 100644 assets/images/raiders.png delete mode 100644 assets/shaders/Paris.frag.glsl diff --git a/assets/canvas-runtime.js b/assets/canvas-runtime.js index 4ab377c6..4181dd89 100644 --- a/assets/canvas-runtime.js +++ b/assets/canvas-runtime.js @@ -635,11 +635,11 @@ NinjaCvsRt.RuntimeGeomObj = Object.create(Object.prototype, { case "plasma": mat = Object.create(NinjaCvsRt.RuntimePlasmaMaterial, {}); break; case "taper": mat = Object.create(NinjaCvsRt.RuntimeTaperMaterial, {}); break; - case "paris": + case "blueSky": case "water": mat = Object.create(NinjaCvsRt.RuntimeWaterMaterial, {}); break; case "deform": - case "raiders": + case "darkBlur": case "tunnel": case "reliefTunnel": case "squareTunnel": diff --git a/assets/descriptor.json b/assets/descriptor.json index d9d74e6b..db824387 100644 --- a/assets/descriptor.json +++ b/assets/descriptor.json @@ -20,9 +20,9 @@ "images/cubelight.png", "images/random_normal.png", "images/white.png", - "images/paris.png", + "images/bluesky.png", "images/powderblue.png", - "images/raiders.png", + "images/darkblur.png", "images/us_flag.png", "shaders/Basic.frag.glsl", "shaders/TwistVert.vert.glsl", @@ -34,9 +34,9 @@ "shaders/linearGradient.frag.glsl", "shaders/linearGradient.vert.glsl", "shaders/plasma.frag.glsl", - "shaders/Paris.frag.glsl", "shaders/plasma.vert.glsl", "shaders/Pulse.frag.glsl", + "shaders/radialBlur.frag.glsl", "shaders/radialGradient.frag.glsl", "shaders/radialGradient.vert.glsl", "shaders/test_fshader.glsl", diff --git a/assets/images/bluesky.png b/assets/images/bluesky.png new file mode 100644 index 00000000..b7ef6c7b Binary files /dev/null and b/assets/images/bluesky.png differ diff --git a/assets/images/darkblur.png b/assets/images/darkblur.png new file mode 100644 index 00000000..64c39c89 Binary files /dev/null and b/assets/images/darkblur.png differ diff --git a/assets/images/paris.png b/assets/images/paris.png deleted file mode 100644 index b7ef6c7b..00000000 Binary files a/assets/images/paris.png and /dev/null differ diff --git a/assets/images/raiders.png b/assets/images/raiders.png deleted file mode 100644 index 64c39c89..00000000 Binary files a/assets/images/raiders.png and /dev/null differ diff --git a/assets/shaders/Paris.frag.glsl b/assets/shaders/Paris.frag.glsl deleted file mode 100644 index 690b1453..00000000 --- a/assets/shaders/Paris.frag.glsl +++ /dev/null @@ -1,68 +0,0 @@ -#ifdef GL_ES -precision highp float; -#endif - -uniform sampler2D u_tex0; -uniform float u_time; -uniform vec2 u_resolution; -const float PI = 3.1415926535897932; - -//speed - -const float speed = 0.1; -const float speed_x = 0.075; -const float speed_y = 0.000; - -// geometry -const float intensity = 1.5; -const int steps = 8; -//const float frequency = 4.0; -const float frequency = 2.0; -const int angle = 7; // better when a prime - -// reflection and emboss -const float delta = 20.; -const float intence = 400.; -const float emboss = 0.3; - -//---------- crystals effect - - float col(vec2 coord) - { - float delta_theta = 2.0 * PI / float(angle); - float col = 0.0; - float theta = 0.0; - for (int i = 0; i < steps; i++) - { - vec2 adjc = coord; - theta = delta_theta*float(i); - adjc.x += cos(theta)*u_time*speed + u_time * speed_x; - adjc.y -= sin(theta)*u_time*speed - u_time * speed_y; - col = col + cos( (adjc.x*cos(theta) - adjc.y*sin(theta))*frequency)*intensity; - } - - return cos(col); - } - -//---------- main - -void main(void) -{ -vec2 p = (gl_FragCoord.xy) / u_resolution.xy, c1 = p, c2 = p; -float cc1 = col(c1); - -c2.x += u_resolution.x/delta; -float dx = emboss*(cc1-col(c2))/delta; - -c2.x = p.x; -c2.y += u_resolution.y/delta; -float dy = emboss*(cc1-col(c2))/delta; - -c1.x += dx; -c1.y = -(c1.y+dy); - -float alpha = 1.+dot(dx,dy)*intence; -gl_FragColor = texture2D(u_tex0,c1)*(alpha); -// gl_FragColor = vec4(col(p),0,0,1); - -} diff --git a/js/io/system/ninjalibrary.json b/js/io/system/ninjalibrary.json index bbf53144..6b74b04f 100644 --- a/js/io/system/ninjalibrary.json +++ b/js/io/system/ninjalibrary.json @@ -1,6 +1,6 @@ { "libraries": [ {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.11.2.1"}, - {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.6.0.4"} + {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.6.0.5"} ] } \ No newline at end of file diff --git a/js/lib/geom/geom-obj.js b/js/lib/geom/geom-obj.js index 3cd3a89b..e0ed51fb 100755 --- a/js/lib/geom/geom-obj.js +++ b/js/lib/geom/geom-obj.js @@ -385,8 +385,8 @@ exports.GeomObj = Object.create(Object.prototype, { case "plasma": case "deform": case "water": - case "paris": - case "raiders": + case "blueSky": + case "darkBlur": case "tunnel": case "reliefTunnel": case "squareTunnel": diff --git a/js/lib/rdge/materials/radial-blur-material.js b/js/lib/rdge/materials/radial-blur-material.js index 1f89f79e..2d26638b 100644 --- a/js/lib/rdge/materials/radial-blur-material.js +++ b/js/lib/rdge/materials/radial-blur-material.js @@ -176,22 +176,22 @@ var radialBlurMaterialDef = }; -var RaidersMaterial = function RaidersMaterial() { +var DarkBlurMaterial = function DarkBlurMaterial() { // initialize the inherited members this.inheritedFrom = RadialBlurMaterial; this.inheritedFrom(); - this._name = "Raiders"; - this._shaderName = "raiders"; + this._name = "Dark Blur"; + this._shaderName = "darkBlur"; - this._texMap = 'assets/images/raiders.png'; + this._texMap = 'assets/images/darkblur.png'; this._propValues[this._propNames[0]] = this._texMap.slice(0); // duplicate method required this.dup = function (world) { // allocate a new uber material - var newMat = new RaidersMaterial(); + var newMat = new DarkBlurMaterial(); // copy over the current values; var propNames = [], propValues = [], propTypes = [], propLabels = []; @@ -204,10 +204,10 @@ var RaidersMaterial = function RaidersMaterial() { }; } -RaidersMaterial.prototype = new Material(); +DarkBlurMaterial.prototype = new Material(); if (typeof exports === "object") { - exports.RaidersMaterial = RaidersMaterial; + exports.DarkBlurMaterial = DarkBlurMaterial; } diff --git a/js/lib/rdge/materials/water-material.js b/js/lib/rdge/materials/water-material.js index c7e7313c..9997244c 100644 --- a/js/lib/rdge/materials/water-material.js +++ b/js/lib/rdge/materials/water-material.js @@ -165,16 +165,16 @@ var waterMaterialDef = } }; -var ParisMaterial = function ParisMaterial() +var BlueSkyMaterial = function BlueSkyMaterial() { // initialize the inherited members this.inheritedFrom = WaterMaterial; this.inheritedFrom(); - this._name = "Paris"; - this._shaderName = "paris"; + this._name = "Blue Sky"; + this._shaderName = "blueSky"; - this._defaultTexMap = 'assets/images/paris.png'; + this._defaultTexMap = 'assets/images/bluesky.png'; this._propValues[this._propNames[0]] = this._defaultTexMap.slice(0); //this._diffuseColor = [0.5, 0.5, 0.5, 0.5]; @@ -191,7 +191,7 @@ var ParisMaterial = function ParisMaterial() this._shader.init(); // set up the material node - this._materialNode = RDGE.createMaterialNode("parisMaterial" + "_" + world.generateUniqueNodeID()); + this._materialNode = RDGE.createMaterialNode("blueSkyMaterial" + "_" + world.generateUniqueNodeID()); this._materialNode.setShader(this._shader); this._time = 0; @@ -206,9 +206,9 @@ var ParisMaterial = function ParisMaterial() } -ParisMaterial.prototype = new PulseMaterial(); +BlueSkyMaterial.prototype = new PulseMaterial(); if (typeof exports === "object") { - exports.ParisMaterial = ParisMaterial; + exports.BlueSkyMaterial = BlueSkyMaterial; } diff --git a/js/models/materials-model.js b/js/models/materials-model.js index 15feca93..ec481933 100755 --- a/js/models/materials-model.js +++ b/js/models/materials-model.js @@ -43,7 +43,7 @@ var BumpMetalMaterial = require("js/lib/rdge/materials/bump-metal-material").Bum var UberMaterial = require("js/lib/rdge/materials/uber-material").UberMaterial; //var CloudMaterial = require("js/lib/rdge/materials/cloud-material").CloudMaterial; var RadialBlurMaterial = require("js/lib/rdge/materials/radial-blur-material").RadialBlurMaterial; -var RaidersMaterial = require("js/lib/rdge/materials/radial-blur-material").RaidersMaterial; +var DarkBlurMaterial = require("js/lib/rdge/materials/radial-blur-material").DarkBlurMaterial; var PlasmaMaterial = require("js/lib/rdge/materials/plasma-material").PlasmaMaterial; var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; //var TunnelMaterial = require("js/lib/rdge/materials/tunnel-material").TunnelMaterial; @@ -52,7 +52,7 @@ var FlagMaterial = require("js/lib/rdge/materials/flag-material").FlagMaterial; //var SquareTunnelMaterial = require("js/lib/rdge/materials/square-tunnel-material").SquareTunnelMaterial; //var FlyMaterial = require("js/lib/rdge/materials/fly-material").FlyMaterial; var WaterMaterial = require("js/lib/rdge/materials/water-material").WaterMaterial; -var ParisMaterial = require("js/lib/rdge/materials/water-material").ParisMaterial; +var BlueSkyMaterial = require("js/lib/rdge/materials/water-material").BlueSkyMaterial; //var ZInvertMaterial = require("js/lib/rdge/materials/z-invert-material").ZInvertMaterial; //var DeformMaterial = require("js/lib/rdge/materials/deform-material").DeformMaterial; //var StarMaterial = require("js/lib/rdge/materials/star-material").StarMaterial; @@ -74,8 +74,10 @@ exports.MaterialsModel = Montage.create(Component, { value: function() { // Load all the materials this.addMaterial(new FlatMaterial()); + this.addMaterial(new BlueSkyMaterial()); this.addMaterial(new BumpMetalMaterial()); //this.addMaterial(new CloudMaterial()); + this.addMaterial(new DarkBlurMaterial()); //this.addMaterial(new DeformMaterial()); this.addMaterial(new FlagMaterial()); //this.addMaterial(new FlyMaterial()); @@ -83,12 +85,10 @@ exports.MaterialsModel = Montage.create(Component, { //this.addMaterial(new KeleidoscopeMaterial()); this.addMaterial(new LinearGradientMaterial()); //this.addMaterial(new MandelMaterial()); - this.addMaterial(new ParisMaterial()); this.addMaterial(new PlasmaMaterial()); this.addMaterial(new PulseMaterial()); this.addMaterial(new RadialBlurMaterial()); this.addMaterial(new RadialGradientMaterial()); - this.addMaterial(new RaidersMaterial()); //this.addMaterial(new ReliefTunnelMaterial()); //this.addMaterial(new SquareTunnelMaterial()); //this.addMaterial(new StarMaterial()); @@ -260,8 +260,8 @@ exports.MaterialsModel = Montage.create(Component, { case "flag": mat = new FlagMaterial(); break; //case "fly": mat = new FlyMaterial(); break; case "water": mat = new WaterMaterial(); break; - case "paris": mat = new ParisMaterial(); break; - case "raiders": mat = new RaidersMaterial(); break; + case "blueSky": mat = new BlueSkyMaterial(); break; + case "darkBlur": mat = new DarkBlurMaterial(); break; //case "zinvert": mat = new ZInvertMaterial(); break; //case "deform": mat = new DeformMaterial(); break; //case "star": mat = new StarMaterial(); break; diff --git a/js/panels/Materials/materials-data.json b/js/panels/Materials/materials-data.json index 8e025185..6fe5da69 100644 --- a/js/panels/Materials/materials-data.json +++ b/js/panels/Materials/materials-data.json @@ -5,10 +5,18 @@ "label": "Ninja Materials", "children": [ { + "label": "Blue Sky", + "id" : "Blue Sky" + }, + { "label": "Bump Metal", "id" : "Bump Metal" }, - { + { + "label": "Dark Blur", + "id" : "Dark Blur" + }, + { "label": "Flag", "id" : "Flag" }, @@ -16,10 +24,6 @@ "label": "Linear Gradient", "id" : "Linear Gradient" }, - { - "label": "Paris", - "id" : "Paris" - }, { "label": "Plasma", "id" : "Plasma" @@ -36,10 +40,6 @@ "label": "Radial Gradient", "id" : "Radial Gradient" }, - { - "label": "Raiders", - "id" : "Raiders" - }, { "label": "Taper", "id" : "Taper" -- cgit v1.2.3