Changeset 420 for branches/thune/thread_safe/gl/scripts/view.t
- Timestamp:
- 06/30/07 08:14:01 (17 months ago)
- Files:
-
- 1 modified
-
branches/thune/thread_safe/gl/scripts/view.t (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/thune/thread_safe/gl/scripts/view.t
r409 r420 1 1 ; Thune GL View 2 2 3 4 "test_fw.t" load do 5 3 < 4 "test_fw.t" load do 5 "scripts/stars.t" load do 6 > 7 8 0.6 :zoom 6 9 10,0,10 :bg-color 7 10 ;off key-repeat 8 11 0.0,0 :win-size 9 10 "shader/matte.gx" load.shader :matte 11 12 "scripts/stars.t" load do 400 make-stars :star-dl 13 "shader/particle-star.gx" 14 load.shader :star-sh 15 16 12 20.0,400 :logo-pos 13 20.0,400 :text-pos 14 15 ;font! ["font/FederationBold_KR.ttf" 16 256,128] make :fontF 16 font! ["font/20thfont.ttf" 22 256,128] make :fontF 17 18 "shader/matte.gx" load.shader :matte 19 "shader/particle-star.gx" load.shader :star-sh 17 20 "shader/particle-sprite.gx" load.shader :sprite-sh 18 21 19 10 make-stars :bstar-dl20 22 sprite-sh :bstar-sh 21 23 500.0 :bstar-sh/size 22 "image/star .png" load.tex :bstar-sh/cmap24 "image/star01.png" load.tex :bstar-sh/cmap 23 25 24 26 "shader/ship-lights.gx" load.shader :flare-sh 25 27 "image/lightFlareA.png" load.tex :flare-sh/cmap 28 29 [ 30 push 31 scale 20.0 ; TODO: move to view-cam pos 32 ;translate view-cam/ 33 34 particle 35 shader star-sh 36 call <400 make-stars> 37 38 particle/sprite 39 shader bstar-sh 40 call <10 make-stars> 41 pop 42 ;particle/off 43 ] 44 draw-list :starfield-dl 45 26 46 27 47 /* … … 76 96 77 97 78 /* 79 [ 80 "model/d7.gx" load draw-list.compile :model-list 81 ;"shader/lumimap.gx" 82 "shader/clsmap.gx" 83 ;"shader/tv.gx" 84 load.shader :model-shader 85 "image/d7_colormap.png" load.tex :model-shader/cmap 86 "image/d7_lights.png" load.tex :model-shader/lmap 98 [ 99 "shader/clsbmap.gx" load.shader :d7-shader 100 "image/d7_colormap.png" load.tex :d7-shader/cmap 101 "image/d7_lights.png" load.tex :d7-shader/lmap 102 "image/d7_normal.png" load.tex :d7-shader/nmap 103 "model/d7_bump.gx" load draw-list.compile dup :model-list :d7-dl 104 105 "model/d7_lights.gx" load do 106 107 [ 108 model 109 shader d7-shader 110 call d7-dl 111 112 shader matte 113 call d7-lights-query 114 particle/sprite 115 shader flare-sh call d7-lights 116 ;particle/off 117 ] 118 draw-list dup :ship-dl :d7-model 87 119 ] :d7 88 */ 89 90 [ 91 "shader/clsbmap.gx" load.shader :model-shader 92 "image/d7_colormap.png" load.tex :model-shader/cmap 93 "image/d7_lights.png" load.tex :model-shader/lmap 94 "image/d7_normal.png" load.tex :model-shader/nmap 95 "model/d7_bump.gx" load draw-list.compile :model-list 96 model-list :d7-dl 97 model-shader :d7-shader 98 99 "model/d7_lights.gx" load do 100 101 now :start-time 102 [ 103 now start-time sub :flare-sh/time 104 ] 105 proc :sim-update 106 107 ] :d7 108 109 [ 110 "model/enterprise.gx" load draw-list.compile :model-list 111 "shader/clsmap.gx" load.shader :model-shader 112 "image/ent_colormap.png" load.mip :model-shader/cmap 113 "image/ent_lights.png" load.tex :model-shader/lmap 114 model-list :ent-dl 115 model-shader :ent-shader 120 121 [ 122 "shader/clsmap.gx" load.shader :ent-shader 123 "image/ent_colormap.png" load.mip :ent-shader/cmap 124 "image/ent_lights.png" load.tex :ent-shader/lmap 125 "model/enterprise.gx" load draw-list.compile dup :model-list :ent-dl 126 127 "model/ent_lights.gx" load do 128 129 [ 130 model 131 shader ent-shader ; FIXME: Causes text not to render. 132 call ent-dl 133 134 shader matte 135 call ent-lights-query 136 particle/sprite 137 shader flare-sh call ent-lights 138 ;particle/off 139 ] 140 draw-list dup :ship-dl :ent-model 116 141 ] :ent 117 142 … … 146 171 147 172 148 /* 149 "model/enterprise.gx" load draw-list.compile :model-list 150 "shader/lh_specular.gx" load.shader :model-shader 151 ;0.5 :model-shader/specular 152 ;0.5 :model-shader/shininess 153 */ 154 155 156 /* 157 "model/enterprise.gx" load draw-list.compile :model-list 158 "shader/spec01_map_s.t" load.shader :model-shader 159 "image/specular_tiles.png" load.tex :model-shader/specularmap 160 64.0 :model-shader/shine 161 */ 173 now :start-time 174 [ 175 now start-time sub :flare-sh/time 176 ] 177 proc :sim-update 178 162 179 163 180 1.0,0.8,1.0 :light-pos … … 189 206 func.env :move-light ; (dx dy -- ) 190 207 208 [ 209 font fontF 210 text 20,148 "LMB^/RMB^/Wheel^/M^/ESC^/F1" 211 text 86,148 212 {- Move Camera^/- Move Light^/- Zoom^/- Change Model^/- Exit^/- Toggle Help} 213 ] 214 draw-list.compile :help-dl 215 help-dl :help 216 191 217 0 0 move-light 192 218 … … 197 223 m [ 198 224 model-list d7-dl same? 199 [ent-dl :model-list ent- shader :model-shader]200 [d7-dl :model-list d7- shader :model-shader]225 [ent-dl :model-list ent-model :ship-dl] 226 [d7-dl :model-list d7-model :ship-dl] 201 227 either 202 228 ] 229 f1 [help none help-dl either :help] 203 230 f10 [display.snapshot "snapshot.png" save.png] 204 231 ] … … 210 237 dup :ortho-cam/viewport 211 238 dup :view-cam/viewport 239 240 area/3 320 sub 16 sub dup :logo-pos/x :text-pos/x 241 area/4 32 sub 16 sub dup :logo-pos/y 20 sub :text-pos/y 212 242 213 243 /* … … 219 249 ] 220 250 221 mouse-move [251 mouse-move [ 222 252 dup :mouse-pos 223 253 mouse-pos/5 [ 224 256[mouse-pos/3 mouse-pos/4 view-cam/turntable]225 512[light-amb mouse-pos/4 0.02 mul add :light-amb]226 1024[mouse-pos/3 mouse-pos/4 move-light]254 <mouse-lb> [mouse-pos/3 mouse-pos/4 view-cam/turntable] 255 <mouse-mb> [light-amb mouse-pos/4 0.02 mul add :light-amb] 256 <mouse-rb> [mouse-pos/3 mouse-pos/4 move-light] 227 257 ] case 228 258 ] 229 259 230 260 mouse-wheel [ 231 dup 0 gt? 1.1 0.90909 either zoom mul :zoom 261 dup 0 gt? 1.1 0.90909 either zoom mul 262 0.01 0.8 limit 263 :zoom 232 264 ] 233 265 … … 243 275 */ 244 276 245 /* 246 */ 247 push 248 scale 20.0 249 250 particle 251 shader star-sh call star-dl 252 253 particle/sprite 254 shader bstar-sh call bstar-dl 255 pop 256 ;particle/off 277 call starfield-dl 257 278 258 279 push 259 280 scale zoom 260 281 261 light [on light-pos ambient light-amb]282 light [on light-pos diffuse 0.8,0.8,0.75 ambient light-amb] 262 283 ;light [on 1.0,0.8,1.0] 263 284 ;light/1 [on -1.0,-0.8,0.0 diffuse 0.8,0.5,0.5] 264 285 265 model 266 shader model-shader 267 call model-list 268 269 shader matte 270 call d7-lights-query 271 particle/sprite 272 shader flare-sh call d7-lights 273 ;particle/off 286 call ship-dl 274 287 pop 275 288 276 289 call sun-dl 277 278 ;ortho-cam 290 shader none 291 292 camera ortho-cam 293 font fontF 294 color $ffffff 295 call help 296 ;call logo 297 text text-pos "Model Demo 1" 298 ;enable/? 299 image/trans logo-pos <"image/warpfleetc.png" load.tex.clamp> 279 300 ] 280 301 ]
