Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamas Schalk committed Nov 7, 2016
2 parents 80680d9 + 2e2e35a commit 42f3927
Show file tree
Hide file tree
Showing 11 changed files with 423 additions and 116 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/.idea/
/src/compiler.jar
/closure-compiler.jar
/releases
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tgen.js

Javascript seamless texture generator v0.4.4
Javascript seamless texture generator v0.4.5

## Sample textures

Expand Down Expand Up @@ -183,6 +183,7 @@ Try the online generator [here](http://seamless-texture.com/generator/)
* noise (color or monochrome)
* checkerboard
* colorbar (gradients)
* dots


## Available filters
Expand Down
11 changes: 11 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

set inputs=src/tgen-base.js src/tgen-colormaps.js src/tgen-blends.js src/tgen-effects.js src/tgen-filters.js src/tgen-shapes.js
set options_min=--language_in ECMASCRIPT5 --compilation_level SIMPLE_OPTIMIZATIONS
set options_debug=--language_in ECMASCRIPT5 --compilation_level WHITESPACE_ONLY --formatting PRETTY_PRINT

rem Google Closure Compiler
rem Download : http://dl.google.com/closure-compiler/compiler-latest.zip
java -jar closure-compiler.jar %options_min% --js %inputs% --js_output_file ./tgen.min.js
java -jar closure-compiler.jar %options_debug% --js %inputs% --js_output_file ./tgen.debug.js

pause
195 changes: 188 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<br/>
<i>The seamless <br/>texture generator</i>
<br/><br/>
&copy; 2015<br/>
&copy; 2015-2016<br/>
<a target="_blank" href="https://github.com/schalkt/">tamas.schalk</a><br/>
<br/>

Expand Down Expand Up @@ -74,7 +74,7 @@

<div id="panel">
<span class="highligth">Control + Enter</span> = Generate
<span class="floatright"><a target="_blank"
<span class="floatright"><a target="_blank"
href="http://ace.c9.io/">Ace</a> - The High Performance Code Editor</span>

<div id="editor"></div>
Expand Down Expand Up @@ -133,6 +133,25 @@
</script>


<script type="text/javascript" id="fire" class="preset" title="fire">
var params = {
"width": 256,
"height": 256,
"items": [

[0, "subplasma", {"size": [2, 4]}],
[0, "subplasma", {"blend": "difference", "size": [1, 4]}],
[0, "subplasma", {"blend": "difference", "size": [1, 4]}],
[0, "subplasma", {"blend": "difference", "size": [1, 4]}],
[0, "subplasma", {"blend": "difference", "size": [1, 4]}],
[0, "spheres", {"blend": ["difference"], "size": [25, 77], "count": 10, "dynamic": true}],
[0, "colorize", {"colormap": "!fire"}],
[0, "contrast", {"value": 42}]
]
}
</script>


<script type="text/javascript" id="stone-and-flowers" class="preset" title="stone-and-flowers">
var params = {
"width": 256,
Expand Down Expand Up @@ -411,31 +430,31 @@
"width": 256,
"height": 256,
"items": [
[4, ["spheres", "pyramids", "waves"], {
[4, ["spheres", "pyramids", "waves", "subplasma"], {
"blend": "lighten",
"rgba": [[0, 255], [0, 255], [0, 255], [0.5, 0.9]],
"dynamic": true
}],

[0, "copy", 4],

[4, ["spheres", "pyramids", "waves"], {
[4, ["spheres", "pyramids", "waves", "subplasma"], {
"blend": "random",
"rgba": [[0, 255], [0, 255], [0, 255], [0.5, 0.9]],
"dynamic": true
}],

[1, "copy", 4],

[4, ["spheres", "pyramids", "waves"], {
[4, ["spheres", "pyramids", "waves", "subplasma"], {
"blend": "random",
"rgba": [[0, 255], [0, 255], [0, 255], [0.5, 0.9]],
"dynamic": true
}],

[2, "copy", 4],

[4, ["spheres", "pyramids", "waves"], {
[4, ["spheres", "pyramids", "waves", "subplasma"], {
"blend": "random",
"rgba": [[0, 255], [0, 255], [0, 255], [0.5, 0.9]],
"dynamic": true
Expand Down Expand Up @@ -696,6 +715,30 @@
}
</script>

<script type="text/javascript" id="spheres-map2" class="preset" title="spheres-map2">
var params = {
"width": 256,
"height": 256,
"items": [
[0, "spheres", {"blend": "lighten", "count": 21}],
[1, "spheres",
{"blend": "lighten", "count": 21}],
[1, "merge", {
"layer": 0, "blend": ["overlay",
"lighten", "difference"]
}],
[1, "map", {
"xamount": [21, 177],
"yamount": [21, 177],
"xchannel": [0, 3],
"ychannel": [0, 3],
"xlayer": [0, 1],
"ylayer": [0, 1]
}]
]
}
</script>


<script type="text/javascript" id="cells" class="preset" title="cells">
var params = {
Expand Down Expand Up @@ -788,6 +831,24 @@
}
</script>

<script type="text/javascript" id="5waves-map" class="preset" title="5 random waves map">
var params = {
"width": 256,
"height": 256,
"items": [
[0, "waves"],
[0, "waves", {"blend": "difference"}],
[0, "waves", {"blend": "linearburn"}],
[0, "waves", {"blend": "difference"}],
[0, "waves", {"blend": "linearburn"}],
[0, "subplasma", {"blend": ["multiply", "difference"]}],
[0, "brightness", {"adjust": 10, "legacy": true}],
[0, "vibrance", {"adjust": 10}],
[0, "map"]
]
}
</script>

<script type="text/javascript" id="bubbles" class="preset" title="bubbles">
var params = {
"width": 256,
Expand Down Expand Up @@ -1040,6 +1101,7 @@
}
</script>


<script type="text/javascript" id="checkerboards-multiply" class="preset" title="checkerboards-multiply">
var params = {
"width": 256,
Expand All @@ -1055,6 +1117,103 @@
</script>


<script type="text/javascript" id="dots" class="preset" title="dots">
var params = {
"width": 256,
"height": 256,
"items": [

[0, "dots", {
"blend": ["opacity", "lighten"],
"shape": "sphere",
"size": [200, 400],
"gridX": [4, 12],
"gridY": [4, 12],
"xsines": [4, 12],
"ysines": [4, 12]
}],
[0, "dots", {
"blend": "random",
"shape": "sphere",
"size": [50, 200],
"gridX": [4, 12],
"gridY": [4, 12],
"xsines": [4, 12],
"ysines": [4, 12]
}],
[0, "sharpen"]
]
}
</script>


<script type="text/javascript" id="sci-fi-wall" class="preset" title="sci-fi-wall">
var params = {
"width": 256,
"height": 256,
"items": [
[0, "waves", {}],
[0, "dots", {
"blend": ["lighten", "opacity", "multiply"],
"shape": "rect",
"size": [20, 250],
"gridX": [2, 12],
"gridY": [2, 12],
"xsines": [2, 12],
"ysines": [2, 12]
}],
[0, "dots", {
"blend": ["lighten", "opacity", "multiply"],
"shape": "rect",
"size": [20, 250],
"gridX": [2, 12],
"gridY": [2, 12],
"xsines": [2, 12],
"ysines": [2, 12]
}],
[0, "sharpen", {"type": 1}],
[0, "spheres", {"blend": ["multiply", "darken"], "dynamic": true, "opacity": 255}]
]
}
</script>


<script type="text/javascript" id="sci-fi-wall2" class="preset" title="sci-fi-wall2">
var params = {
"width": 256,
"height": 256,
"items": [
[0, "waves", {}],
[0, "dots", {
"blend": ["lighten", "opacity", "multiply"],
"shape": "rect",
"size": [10, 280],
"gridX": [2, 14],
"gridY": [2, 14],
"xsines": [2, 14],
"ysines": [2, 14]
}],
[0, "dots", {
"blend": ["lighten", "opacity", "multiply"],
"shape": "rect",
"size": [10, 280],
"gridX": [2, 14],
"gridY": [2, 14],
"xsines": [2, 14],
"ysines": [2, 14]
}],
[0, "pyramids", {
"blend": ["softlight", "overlay"],
"dynamic": false,
"count": 10
}],
[0, "sharpen", {"type": 1}],
[0, "spheres", {"blend": ["multiply", "darken"], "dynamic": true, "opacity": 255}]
]
}
</script>


<script type="text/javascript" id="lines" class="preset" title="lines (under dev)">
var params = {
"width": 256,
Expand All @@ -1080,6 +1239,7 @@
}
</script>


<script type="text/javascript" id="lines2" class="preset" title="lines2">
var params = {
"width": 256,
Expand Down Expand Up @@ -1156,9 +1316,30 @@
</script>


<script type="text/javascript" id="dev" class="preset" title="dev">
var params = {
"width": 256,
"height": 256,
"items": [
[0, "fill"],
[0, "dots", {
"blend": ["lighten", "opacity"],
"shape": "circle"
}],
[0, "dots", {
"blend": ["lighten", "multiply"],
"shape": "circle"
}],
[0, "sharpen", {"type": 1}],
[0, "spheres", {"blend": "multiply", "dynamic": true, "opacity": 255}]
]
}
</script>


<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.8/ace.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r71/three.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r75/three.min.js" type="text/javascript"></script>
<script src="src/tgen-base.js"></script>
<script src="src/tgen-blends.js"></script>
<script src="src/tgen-colormaps.js"></script>
Expand Down
6 changes: 1 addition & 5 deletions samples.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@
</div>

<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="src/tgen-base.js"></script>
<script src="src/tgen-blends.js"></script>
<script src="src/tgen-shapes.js"></script>
<script src="src/tgen-filters.js"></script>
<script src="src/tgen-effects.js"></script>
<script src="tgen.min.js"></script>
<script src="src/tgen-events.js"></script>
<script src="src/tgen-tests.js"></script>

Expand Down
11 changes: 0 additions & 11 deletions src/compress.cmd

This file was deleted.

8 changes: 4 additions & 4 deletions src/tgen-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
* Copyright (c) 2015 Tamas Schalk
* MIT license
*
* @version 0.4.4
* @version 0.4.5
*/

(function (fn) {

window[fn] = {

version: '0.4.4',
version: '0.4.5',
defaults: {},
effects: {},
blends: {},
Expand Down Expand Up @@ -234,8 +234,8 @@

this.offset = function (x, y) {

x = parseInt(x, 10);
y = parseInt(y, 10);
x = Math.round(x);
y = Math.round(y);

// if x not in the correct size
if (x < 0 || x >= this.width) {
Expand Down
Loading

0 comments on commit 42f3927

Please sign in to comment.