diff options
Diffstat (limited to 'js/helper-classes/RDGE/src/core/script/jpass.js')
-rwxr-xr-x | js/helper-classes/RDGE/src/core/script/jpass.js | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/js/helper-classes/RDGE/src/core/script/jpass.js b/js/helper-classes/RDGE/src/core/script/jpass.js index e3c5a342..934f0268 100755 --- a/js/helper-classes/RDGE/src/core/script/jpass.js +++ b/js/helper-classes/RDGE/src/core/script/jpass.js | |||
@@ -33,8 +33,8 @@ POSSIBILITY OF SUCH DAMAGE. | |||
33 | var RDGE = RDGE || {}; | 33 | var RDGE = RDGE || {}; |
34 | 34 | ||
35 | /* | 35 | /* |
36 | * jpass geometry set - determines the category(s) of geometry that a pass will render | 36 | * jpass geometry set - determines the category(s) of geometry that a pass will render |
37 | * can be OR'ed together | 37 | * can be OR'ed together |
38 | */ | 38 | */ |
39 | RDGE.jpassGeoSet = | 39 | RDGE.jpassGeoSet = |
40 | { | 40 | { |
@@ -52,8 +52,8 @@ RDGE.jpassGeoSet = | |||
52 | 52 | ||
53 | 53 | ||
54 | /* | 54 | /* |
55 | * The abstract base class that defines a jpass | 55 | * The abstract base class that defines a jpass |
56 | * a jpass represents a single render pass of the scene graph | 56 | * a jpass represents a single render pass of the scene graph |
57 | */ | 57 | */ |
58 | RDGE._jpassBaseClass = function () { | 58 | RDGE._jpassBaseClass = function () { |
59 | this.context = RDGE.globals.engine.getContext(); | 59 | this.context = RDGE.globals.engine.getContext(); |
@@ -74,18 +74,18 @@ RDGE._jpassBaseClass = function () { | |||
74 | this.name = "renderPass_" + RDGE.nodeIdGen.getId(); | 74 | this.name = "renderPass_" + RDGE.nodeIdGen.getId(); |
75 | 75 | ||
76 | /* | 76 | /* |
77 | * if 0 this pass and children are culled from rendering | 77 | * if 0 this pass and children are culled from rendering |
78 | */ | 78 | */ |
79 | this.visibility = 1; | 79 | this.visibility = 1; |
80 | 80 | ||
81 | /* | 81 | /* |
82 | * called when the pass is hidden - override for customication | 82 | * called when the pass is hidden - override for customication |
83 | */ | 83 | */ |
84 | this.onHide = function () { | 84 | this.onHide = function () { |
85 | }; | 85 | }; |
86 | 86 | ||
87 | /* | 87 | /* |
88 | * Called by the system to hide the pass and its children | 88 | * Called by the system to hide the pass and its children |
89 | */ | 89 | */ |
90 | this.hidePass = function () { | 90 | this.hidePass = function () { |
91 | this.onHide(); | 91 | this.onHide(); |
@@ -96,7 +96,7 @@ RDGE._jpassBaseClass = function () { | |||
96 | }; | 96 | }; |
97 | 97 | ||
98 | /* | 98 | /* |
99 | * the default output render targets that this pass will create | 99 | * the default output render targets that this pass will create |
100 | */ | 100 | */ |
101 | this.defaultTargetOut = {}; | 101 | this.defaultTargetOut = {}; |
102 | 102 | ||
@@ -104,87 +104,87 @@ RDGE._jpassBaseClass = function () { | |||
104 | * All the outputs required by the pass | 104 | * All the outputs required by the pass |
105 | */ | 105 | */ |
106 | this.outputs = | 106 | this.outputs = |
107 | [ | 107 | [ |
108 | // example | 108 | // example |
109 | // {'name':"u_mainRT", 'type':"target", 'width':1024, 'height':1024, 'mips':false} | 109 | // {'name':"u_mainRT", 'type':"target", 'width':1024, 'height':1024, 'mips':false} |
110 | ]; | 110 | ]; |
111 | 111 | ||
112 | /* | 112 | /* |
113 | * notifies the the renderer that the viewport was modified and needs to be reset | 113 | * notifies the the renderer that the viewport was modified and needs to be reset |
114 | */ | 114 | */ |
115 | this.dirty = false; | 115 | this.dirty = false; |
116 | 116 | ||
117 | /* | 117 | /* |
118 | * Index of the currently selected output target | 118 | * Index of the currently selected output target |
119 | */ | 119 | */ |
120 | this.outputIndex = 0; | 120 | this.outputIndex = 0; |
121 | 121 | ||
122 | /* | 122 | /* |
123 | * outputs from the previous pass are set as inputs for this pass | 123 | * outputs from the previous pass are set as inputs for this pass |
124 | */ | 124 | */ |
125 | this.inputs = []; | 125 | this.inputs = []; |
126 | 126 | ||
127 | /* | 127 | /* |
128 | * other textures requested for this pass | 128 | * other textures requested for this pass |
129 | */ | 129 | */ |
130 | this.textures = []; | 130 | this.textures = []; |
131 | 131 | ||
132 | /* | 132 | /* |
133 | * the flags that control how the pass is rendered | 133 | * the flags that control how the pass is rendered |
134 | */ | 134 | */ |
135 | this.frustum_culling = "enable"; // disable/enable frustum culling during the pass | 135 | this.frustum_culling = "enable"; // disable/enable frustum culling during the pass |
136 | this.clear = null; // flags to clear the output target with before rendering | 136 | this.clear = null; // flags to clear the output target with before rendering |
137 | this.clearColor = null; | 137 | this.clearColor = null; |
138 | 138 | ||
139 | /* | 139 | /* |
140 | * Contains a list of geometry to be rendered, during a post process render pass this will usually by a screen quad | 140 | * Contains a list of geometry to be rendered, during a post process render pass this will usually by a screen quad |
141 | */ | 141 | */ |
142 | this.renderList = | 142 | this.renderList = |
143 | [ | 143 | [ |
144 | // example | 144 | // example |
145 | // { 'name':'opaqeobjects', 'geo'{ 'OPAQUE':[ new renderObject(meshNode, transformNode, RenderContext)]} } | 145 | // { 'name':'opaqeobjects', 'geo'{ 'OPAQUE':[ new renderObject(meshNode, transformNode, RenderContext)]} } |
146 | ]; | 146 | ]; |
147 | 147 | ||
148 | /* | 148 | /* |
149 | * The passes that will render after this pass | 149 | * The passes that will render after this pass |
150 | */ | 150 | */ |
151 | this.children = []; | 151 | this.children = []; |
152 | 152 | ||
153 | /* | 153 | /* |
154 | * This shader will override all other shaders | 154 | * This shader will override all other shaders |
155 | */ | 155 | */ |
156 | this.shader = null; | 156 | this.shader = null; |
157 | 157 | ||
158 | /* | 158 | /* |
159 | * Technique of from shader to use, if null currently set technique is used | 159 | * Technique of from shader to use, if null currently set technique is used |
160 | */ | 160 | */ |
161 | this.technique = null; | 161 | this.technique = null; |
162 | 162 | ||
163 | /* | 163 | /* |
164 | * determines the geometry that will be rendered during the pass | 164 | * determines the geometry that will be rendered during the pass |
165 | */ | 165 | */ |
166 | this.geometrySet = "SCREEN_QUAD"; | 166 | this.geometrySet = "SCREEN_QUAD"; |
167 | 167 | ||
168 | /* | 168 | /* |
169 | * A camera set here will override any camera active in the scene | 169 | * A camera set here will override any camera active in the scene |
170 | */ | 170 | */ |
171 | this.camera = null; | 171 | this.camera = null; |
172 | 172 | ||
173 | /* | 173 | /* |
174 | * Initialize the pass | 174 | * Initialize the pass |
175 | */ | 175 | */ |
176 | this.init = function () { | 176 | this.init = function () { |
177 | }; | 177 | }; |
178 | 178 | ||
179 | /* | 179 | /* |
180 | * inserts a node into the child map using the pass name as the key | 180 | * inserts a node into the child map using the pass name as the key |
181 | */ | 181 | */ |
182 | this.insertChildPass = function (jpassObj) { | 182 | this.insertChildPass = function (jpassObj) { |
183 | this.children[jpassObj.name] = jpassObj; | 183 | this.children[jpassObj.name] = jpassObj; |
184 | }; | 184 | }; |
185 | 185 | ||
186 | /* | 186 | /* |
187 | * the scene-graph to process | 187 | * the scene-graph to process |
188 | */ | 188 | */ |
189 | this.process = function () { | 189 | this.process = function () { |
190 | // pre-defined local variables to prevent allocation | 190 | // pre-defined local variables to prevent allocation |
@@ -227,7 +227,7 @@ RDGE._jpassBaseClass = function () { | |||
227 | RDGE.rdgeGlobalParameters.u_projMatrix.set(renderer.projectionMatrix); | 227 | RDGE.rdgeGlobalParameters.u_projMatrix.set(renderer.projectionMatrix); |
228 | 228 | ||
229 | for (var bucketIdx = 0, bckCnt = this.renderList.length; bucketIdx < bckCnt; ++bucketIdx) { | 229 | for (var bucketIdx = 0, bckCnt = this.renderList.length; bucketIdx < bckCnt; ++bucketIdx) { |
230 | //var curList = this.renderList[bucketIdx]; | 230 | //var curList = this.renderList[bucketIdx]; |
231 | listCount = this.renderList[bucketIdx].length; | 231 | listCount = this.renderList[bucketIdx].length; |
232 | 232 | ||
233 | for (nodeIdx = 0; nodeIdx < listCount; ++nodeIdx) { | 233 | for (nodeIdx = 0; nodeIdx < listCount; ++nodeIdx) { |
@@ -293,22 +293,22 @@ RDGE._jpassBaseClass = function () { | |||
293 | }; | 293 | }; |
294 | 294 | ||
295 | /* | 295 | /* |
296 | * handle any setup 'before' processing the geo/scenegraph | 296 | * handle any setup 'before' processing the geo/scenegraph |
297 | * the first step in the pass | 297 | * the first step in the pass |
298 | */ | 298 | */ |
299 | this.preRender = function () { | 299 | this.preRender = function () { |
300 | }; | 300 | }; |
301 | 301 | ||
302 | /* |