ogre.rb 0.1-i686-linux
Sign up to get free protection for your applications and to get access to all the features.
- data/README +79 -0
- data/Rakefile +288 -0
- data/doc_src/ogre.rb +246 -0
- data/doc_src/ois.rb +67 -0
- data/lib/application.rb +146 -0
- data/lib/application_frame_listener.rb +302 -0
- data/lib/application_loading_bar.rb +115 -0
- data/lib/constants.rb +51 -0
- data/lib/method_fixes.rb +42 -0
- data/lib/ogre.so +0 -0
- data/lib/ruby_ois.so +0 -0
- data/ogre.rb +25 -0
- data/platform.rb +23 -0
- data/samples/Ogre.log +261 -0
- data/samples/bsp.rb +76 -0
- data/samples/cg.dll +0 -0
- data/samples/grass.rb +325 -0
- data/samples/js3250.dll +0 -0
- data/samples/lighting.rb +138 -0
- data/samples/media/materials/programs/Grass.cg +30 -0
- data/samples/media/materials/programs/OffsetMapping.cg +97 -0
- data/samples/media/materials/programs/OffsetMapping.hlsl +135 -0
- data/samples/media/materials/programs/OffsetMappingFp.glsl +69 -0
- data/samples/media/materials/programs/OffsetMappingVp.glsl +54 -0
- data/samples/media/materials/programs/OffsetMapping_specular.asm +44 -0
- data/samples/media/materials/scripts/CloudySky.material +17 -0
- data/samples/media/materials/scripts/CubeMapping.material +34 -0
- data/samples/media/materials/scripts/Flare.material +17 -0
- data/samples/media/materials/scripts/Grass.material +63 -0
- data/samples/media/materials/scripts/Knot.material +14 -0
- data/samples/media/materials/scripts/MorningSkyBox.material +17 -0
- data/samples/media/materials/scripts/Offset.material +124 -0
- data/samples/media/materials/scripts/Ogre.material +119 -0
- data/samples/media/materials/scripts/RZR-002.material +15 -0
- data/samples/media/materials/scripts/Razor.material +14 -0
- data/samples/media/materials/scripts/Ribbon.material +19 -0
- data/samples/media/materials/scripts/RustySteel.material +14 -0
- data/samples/media/materials/scripts/SpaceSkyBox.material +17 -0
- data/samples/media/materials/scripts/SpaceSkyPlane.material +17 -0
- data/samples/media/materials/scripts/TextureEffects.material +15 -0
- data/samples/media/materials/scripts/dragon.material +42 -0
- data/samples/media/materials/scripts/smoke.material +18 -0
- data/samples/media/materials/textures/GreenSkin.jpg +0 -0
- data/samples/media/materials/textures/MtlPlat2.jpg +0 -0
- data/samples/media/materials/textures/RZR-002.png +0 -0
- data/samples/media/materials/textures/RustedMetal.jpg +0 -0
- data/samples/media/materials/textures/RustySteel.jpg +0 -0
- data/samples/media/materials/textures/Water02.jpg +0 -0
- data/samples/media/materials/textures/WeirdEye.png +0 -0
- data/samples/media/materials/textures/clouds.jpg +0 -0
- data/samples/media/materials/textures/cursor.png +0 -0
- data/samples/media/materials/textures/dirt01.jpg +0 -0
- data/samples/media/materials/textures/flare.png +0 -0
- data/samples/media/materials/textures/gras_02.png +0 -0
- data/samples/media/materials/textures/grass_1024.jpg +0 -0
- data/samples/media/materials/textures/ogreborder.png +0 -0
- data/samples/media/materials/textures/ogreborderUp.png +0 -0
- data/samples/media/materials/textures/ribbonband.png +0 -0
- data/samples/media/materials/textures/rockwall.tga +0 -0
- data/samples/media/materials/textures/rockwall_NH.tga +0 -0
- data/samples/media/materials/textures/smoke.png +0 -0
- data/samples/media/materials/textures/smokecolors.png +0 -0
- data/samples/media/materials/textures/spacesky.jpg +0 -0
- data/samples/media/materials/textures/spheremap.png +0 -0
- data/samples/media/materials/textures/texmap2.jpg +0 -0
- data/samples/media/models/RZR-002.mesh +0 -0
- data/samples/media/models/geosphere4500.mesh +0 -0
- data/samples/media/models/geosphere8000.mesh +0 -0
- data/samples/media/models/knot.mesh +0 -0
- data/samples/media/models/ogrehead.mesh +0 -0
- data/samples/media/models/razor.mesh +0 -0
- data/samples/media/models/sphere.mesh +0 -0
- data/samples/media/overlays/CubeMapping.overlay +139 -0
- data/samples/media/packs/OgreCore.zip +0 -0
- data/samples/media/packs/chiropteraDM.pk3 +0 -0
- data/samples/media/packs/chiropteraDM.txt +99 -0
- data/samples/media/packs/cubemap.zip +0 -0
- data/samples/media/packs/cubemapsJS.zip +0 -0
- data/samples/media/packs/dragon.zip +0 -0
- data/samples/media/packs/skybox.zip +0 -0
- data/samples/media/particles/smoke.particle +43 -0
- data/samples/media.cfg +22 -0
- data/samples/navi/Media/NaviDemo.material +60 -0
- data/samples/navi/Media/OgreCore.zip +0 -0
- data/samples/navi/Media/cerulean.jpg +0 -0
- data/samples/navi/Media/clouds.jpg +0 -0
- data/samples/navi/Media/controlsNaviMask.png +0 -0
- data/samples/navi/Media/grass.jpg +0 -0
- data/samples/navi/Media/knot.mesh +0 -0
- data/samples/navi/Media/testNaviMask.png +0 -0
- data/samples/navi/NaviLocal/Navi.js +136 -0
- data/samples/navi/NaviLocal/buttonBg.jpg +0 -0
- data/samples/navi/NaviLocal/controls.html +303 -0
- data/samples/navi/NaviLocal/knobBg.jpg +0 -0
- data/samples/navi/NaviLocal/moo.dropdownmenu.js +87 -0
- data/samples/navi/NaviLocal/mootools.v1.1.js +6964 -0
- data/samples/navi/NaviLocal/naviLogo.html +32 -0
- data/samples/navi/NaviLocal/naviLogo.png +0 -0
- data/samples/navi/NaviLocal/pageBg.jpg +0 -0
- data/samples/navi/NaviLocal/sliderBg.jpg +0 -0
- data/samples/navi/NaviLocal/test.html +5 -0
- data/samples/navi/NaviLocal/welcome.html +36 -0
- data/samples/navi/NaviLocal/welcome.png +0 -0
- data/samples/navi/chrome/chromelist.txt +597 -0
- data/samples/navi/chrome/classic.jar +0 -0
- data/samples/navi/chrome/classic.manifest +4 -0
- data/samples/navi/chrome/comm.jar +0 -0
- data/samples/navi/chrome/comm.manifest +2 -0
- data/samples/navi/chrome/en-US.jar +0 -0
- data/samples/navi/chrome/en-US.manifest +9 -0
- data/samples/navi/chrome/toolkit.jar +0 -0
- data/samples/navi/chrome/toolkit.manifest +6 -0
- data/samples/navi/components/FeedProcessor.js +1825 -0
- data/samples/navi/components/alerts.xpt +0 -0
- data/samples/navi/components/appshell.xpt +0 -0
- data/samples/navi/components/appstartup.xpt +0 -0
- data/samples/navi/components/auth.dll +0 -0
- data/samples/navi/components/autocomplete.xpt +0 -0
- data/samples/navi/components/autoconfig.dll +0 -0
- data/samples/navi/components/autoconfig.xpt +0 -0
- data/samples/navi/components/caps.xpt +0 -0
- data/samples/navi/components/chardet.xpt +0 -0
- data/samples/navi/components/chrome.xpt +0 -0
- data/samples/navi/components/commandhandler.xpt +0 -0
- data/samples/navi/components/commandlines.xpt +0 -0
- data/samples/navi/components/composer.xpt +0 -0
- data/samples/navi/components/compreg.dat +1474 -0
- data/samples/navi/components/content_base.xpt +0 -0
- data/samples/navi/components/content_html.xpt +0 -0
- data/samples/navi/components/content_htmldoc.xpt +0 -0
- data/samples/navi/components/content_xmldoc.xpt +0 -0
- data/samples/navi/components/content_xslt.xpt +0 -0
- data/samples/navi/components/content_xtf.xpt +0 -0
- data/samples/navi/components/directory.xpt +0 -0
- data/samples/navi/components/docshell_base.xpt +0 -0
- data/samples/navi/components/dom.xpt +0 -0
- data/samples/navi/components/dom_base.xpt +0 -0
- data/samples/navi/components/dom_canvas.xpt +0 -0
- data/samples/navi/components/dom_core.xpt +0 -0
- data/samples/navi/components/dom_css.xpt +0 -0
- data/samples/navi/components/dom_events.xpt +0 -0
- data/samples/navi/components/dom_html.xpt +0 -0
- data/samples/navi/components/dom_loadsave.xpt +0 -0
- data/samples/navi/components/dom_range.xpt +0 -0
- data/samples/navi/components/dom_sidebar.xpt +0 -0
- data/samples/navi/components/dom_storage.xpt +0 -0
- data/samples/navi/components/dom_stylesheets.xpt +0 -0
- data/samples/navi/components/dom_svg.xpt +0 -0
- data/samples/navi/components/dom_traversal.xpt +0 -0
- data/samples/navi/components/dom_views.xpt +0 -0
- data/samples/navi/components/dom_xbl.xpt +0 -0
- data/samples/navi/components/dom_xpath.xpt +0 -0
- data/samples/navi/components/dom_xul.xpt +0 -0
- data/samples/navi/components/downloads.xpt +0 -0
- data/samples/navi/components/editor.xpt +0 -0
- data/samples/navi/components/embed_base.xpt +0 -0
- data/samples/navi/components/extensions.xpt +0 -0
- data/samples/navi/components/exthandler.xpt +0 -0
- data/samples/navi/components/fastfind.xpt +0 -0
- data/samples/navi/components/feeds.xpt +0 -0
- data/samples/navi/components/find.xpt +0 -0
- data/samples/navi/components/gfx.xpt +0 -0
- data/samples/navi/components/gksvgrenderer.xpt +0 -0
- data/samples/navi/components/history.xpt +0 -0
- data/samples/navi/components/htmlparser.xpt +0 -0
- data/samples/navi/components/imglib2.xpt +0 -0
- data/samples/navi/components/inspector.xpt +0 -0
- data/samples/navi/components/intl.xpt +0 -0
- data/samples/navi/components/intlcmpt.xpt +0 -0
- data/samples/navi/components/jar.xpt +0 -0
- data/samples/navi/components/jsconsole-clhandler.js +170 -0
- data/samples/navi/components/jsconsole.xpt +0 -0
- data/samples/navi/components/jsdservice.xpt +0 -0
- data/samples/navi/components/layout_base.xpt +0 -0
- data/samples/navi/components/layout_printing.xpt +0 -0
- data/samples/navi/components/layout_xul.xpt +0 -0
- data/samples/navi/components/layout_xul_tree.xpt +0 -0
- data/samples/navi/components/locale.xpt +0 -0
- data/samples/navi/components/lwbrk.xpt +0 -0
- data/samples/navi/components/mimetype.xpt +0 -0
- data/samples/navi/components/mozbrwsr.xpt +0 -0
- data/samples/navi/components/mozfind.xpt +0 -0
- data/samples/navi/components/necko.xpt +0 -0
- data/samples/navi/components/necko_about.xpt +0 -0
- data/samples/navi/components/necko_cache.xpt +0 -0
- data/samples/navi/components/necko_cookie.xpt +0 -0
- data/samples/navi/components/necko_data.xpt +0 -0
- data/samples/navi/components/necko_dns.xpt +0 -0
- data/samples/navi/components/necko_file.xpt +0 -0
- data/samples/navi/components/necko_ftp.xpt +0 -0
- data/samples/navi/components/necko_http.xpt +0 -0
- data/samples/navi/components/necko_res.xpt +0 -0
- data/samples/navi/components/necko_socket.xpt +0 -0
- data/samples/navi/components/necko_strconv.xpt +0 -0
- data/samples/navi/components/necko_viewsource.xpt +0 -0
- data/samples/navi/components/nsCloseAllWindows.js +143 -0
- data/samples/navi/components/nsDefaultCLH.js +231 -0
- data/samples/navi/components/nsDictionary.js +148 -0
- data/samples/navi/components/nsExtensionManager.js +8497 -0
- data/samples/navi/components/nsHelperAppDlg.js +990 -0
- data/samples/navi/components/nsInterfaceInfoToIDL.js +590 -0
- data/samples/navi/components/nsKillAll.js +200 -0
- data/samples/navi/components/nsPostUpdateWin.js +711 -0
- data/samples/navi/components/nsProgressDialog.js +949 -0
- data/samples/navi/components/nsProxyAutoConfig.js +396 -0
- data/samples/navi/components/nsResetPref.js +175 -0
- data/samples/navi/components/nsURLFormatter.js +179 -0
- data/samples/navi/components/nsUpdateService.js +3074 -0
- data/samples/navi/components/nsXULAppInstall.js +301 -0
- data/samples/navi/components/nsXmlRpcClient.js +1038 -0
- data/samples/navi/components/oji.xpt +0 -0
- data/samples/navi/components/passwordmgr.xpt +0 -0
- data/samples/navi/components/pipboot.xpt +0 -0
- data/samples/navi/components/pipnss.xpt +0 -0
- data/samples/navi/components/plugin.xpt +0 -0
- data/samples/navi/components/pref.xpt +0 -0
- data/samples/navi/components/prefetch.xpt +0 -0
- data/samples/navi/components/profile.xpt +0 -0
- data/samples/navi/components/progressDlg.xpt +0 -0
- data/samples/navi/components/proxyObject.xpt +0 -0
- data/samples/navi/components/rdf.xpt +0 -0
- data/samples/navi/components/satchel.xpt +0 -0
- data/samples/navi/components/saxparser.xpt +0 -0
- data/samples/navi/components/shistory.xpt +0 -0
- data/samples/navi/components/storage.xpt +0 -0
- data/samples/navi/components/toolkitprofile.xpt +0 -0
- data/samples/navi/components/transformiix.dll +0 -0
- data/samples/navi/components/txmgr.xpt +0 -0
- data/samples/navi/components/txtsvc.xpt +0 -0
- data/samples/navi/components/uconv.xpt +0 -0
- data/samples/navi/components/unicharutil.xpt +0 -0
- data/samples/navi/components/universalchardet.dll +0 -0
- data/samples/navi/components/update.xpt +0 -0
- data/samples/navi/components/uriloader.xpt +0 -0
- data/samples/navi/components/urlformatter.xpt +0 -0
- data/samples/navi/components/webBrowser_core.xpt +0 -0
- data/samples/navi/components/webbrowserpersist.xpt +0 -0
- data/samples/navi/components/webshell_idls.xpt +0 -0
- data/samples/navi/components/websrvcs.dll +0 -0
- data/samples/navi/components/websrvcs.xpt +0 -0
- data/samples/navi/components/widget.xpt +0 -0
- data/samples/navi/components/windowds.xpt +0 -0
- data/samples/navi/components/windowwatcher.xpt +0 -0
- data/samples/navi/components/xml-rpc.xpt +0 -0
- data/samples/navi/components/xmlextras.dll +0 -0
- data/samples/navi/components/xpcom_base.xpt +0 -0
- data/samples/navi/components/xpcom_components.xpt +0 -0
- data/samples/navi/components/xpcom_ds.xpt +0 -0
- data/samples/navi/components/xpcom_io.xpt +0 -0
- data/samples/navi/components/xpcom_obsolete.xpt +0 -0
- data/samples/navi/components/xpcom_thread.xpt +0 -0
- data/samples/navi/components/xpcom_xpti.xpt +0 -0
- data/samples/navi/components/xpconnect.xpt +0 -0
- data/samples/navi/components/xpinstall.xpt +0 -0
- data/samples/navi/components/xpti.dat +1424 -0
- data/samples/navi/components/xulapp.xpt +0 -0
- data/samples/navi/components/xulapp_setup.xpt +0 -0
- data/samples/navi/components/xuldoc.xpt +0 -0
- data/samples/navi/components/xulrunner.xpt +0 -0
- data/samples/navi/components/xultmpl.xpt +0 -0
- data/samples/navi/components/xulutil.dll +0 -0
- data/samples/navi/controlsNaviMask.png +0 -0
- data/samples/navi/greprefs/all.js +1344 -0
- data/samples/navi/greprefs/security-prefs.js +69 -0
- data/samples/navi/greprefs/xpinstall.js +2 -0
- data/samples/navi/navi_demo.rb +207 -0
- data/samples/navi/plugins/NPSWF32.dll +0 -0
- data/samples/navi/plugins/flashplayer.xpt +0 -0
- data/samples/navi/plugins/npnul32.dll +0 -0
- data/samples/navi/plugins.cfg +10 -0
- data/samples/navi/res/EditorOverride.css +359 -0
- data/samples/navi/res/Thumbs.db +0 -0
- data/samples/navi/res/arrow.gif +0 -0
- data/samples/navi/res/arrowd.gif +0 -0
- data/samples/navi/res/bloatcycle.html +40 -0
- data/samples/navi/res/broken-image.gif +0 -0
- data/samples/navi/res/charsetData.properties +199 -0
- data/samples/navi/res/charsetalias.properties +517 -0
- data/samples/navi/res/cmessage.txt +1 -0
- data/samples/navi/res/dtd/xhtml11.dtd +300 -0
- data/samples/navi/res/entityTables/html40Latin1.properties +146 -0
- data/samples/navi/res/entityTables/html40Special.properties +69 -0
- data/samples/navi/res/entityTables/html40Symbols.properties +164 -0
- data/samples/navi/res/entityTables/htmlEntityVersions.properties +50 -0
- data/samples/navi/res/entityTables/transliterate.properties +2367 -0
- data/samples/navi/res/fonts/fontEncoding.properties +127 -0
- data/samples/navi/res/fonts/fontNameMap.properties +134 -0
- data/samples/navi/res/forms.css +531 -0
- data/samples/navi/res/grabber.gif +0 -0
- data/samples/navi/res/hiddenWindow.html +1 -0
- data/samples/navi/res/html/Thumbs.db +0 -0
- data/samples/navi/res/html/gopher-audio.gif +0 -0
- data/samples/navi/res/html/gopher-binary.gif +0 -0
- data/samples/navi/res/html/gopher-find.gif +0 -0
- data/samples/navi/res/html/gopher-image.gif +0 -0
- data/samples/navi/res/html/gopher-menu.gif +0 -0
- data/samples/navi/res/html/gopher-movie.gif +0 -0
- data/samples/navi/res/html/gopher-sound.gif +0 -0
- data/samples/navi/res/html/gopher-telnet.gif +0 -0
- data/samples/navi/res/html/gopher-text.gif +0 -0
- data/samples/navi/res/html/gopher-unknown.gif +0 -0
- data/samples/navi/res/html.css +478 -0
- data/samples/navi/res/langGroups.properties +236 -0
- data/samples/navi/res/language.properties +259 -0
- data/samples/navi/res/loading-image.gif +0 -0
- data/samples/navi/res/quirk.css +282 -0
- data/samples/navi/res/samples/Anieyes.gif +0 -0
- data/samples/navi/res/samples/Thumbs.db +0 -0
- data/samples/navi/res/samples/aform.css +69 -0
- data/samples/navi/res/samples/beeptest.html +18 -0
- data/samples/navi/res/samples/bform.css +45 -0
- data/samples/navi/res/samples/bg.jpg +0 -0
- data/samples/navi/res/samples/cform.css +40 -0
- data/samples/navi/res/samples/checkboxTest.xul +47 -0
- data/samples/navi/res/samples/demoform.css +97 -0
- data/samples/navi/res/samples/find.html +97 -0
- data/samples/navi/res/samples/gear1.gif +0 -0
- data/samples/navi/res/samples/image_props.html +58 -0
- data/samples/navi/res/samples/mozform.css +256 -0
- data/samples/navi/res/samples/printsetup.html +175 -0
- data/samples/navi/res/samples/raptor.jpg +0 -0
- data/samples/navi/res/samples/rock_gra.gif +0 -0
- data/samples/navi/res/samples/scrollbarTest1.xul +66 -0
- data/samples/navi/res/samples/scrollbarTest2.xul +19 -0
- data/samples/navi/res/samples/sliderTest1.xul +14 -0
- data/samples/navi/res/samples/soundtest.html +20 -0
- data/samples/navi/res/samples/test.wav +0 -0
- data/samples/navi/res/samples/test0.html +220 -0
- data/samples/navi/res/samples/test1.html +84 -0
- data/samples/navi/res/samples/test10.html +16 -0
- data/samples/navi/res/samples/test11.html +42 -0
- data/samples/navi/res/samples/test12.html +79 -0
- data/samples/navi/res/samples/test13.html +126 -0
- data/samples/navi/res/samples/test14.html +5 -0
- data/samples/navi/res/samples/test15.html +5 -0
- data/samples/navi/res/samples/test16.html +124 -0
- data/samples/navi/res/samples/test2.html +41 -0
- data/samples/navi/res/samples/test3.html +126 -0
- data/samples/navi/res/samples/test4.html +335 -0
- data/samples/navi/res/samples/test5.html +199 -0
- data/samples/navi/res/samples/test6.html +335 -0
- data/samples/navi/res/samples/test7.html +11 -0
- data/samples/navi/res/samples/test8-1.html +66 -0
- data/samples/navi/res/samples/test8.html +662 -0
- data/samples/navi/res/samples/test8dom.html +64 -0
- data/samples/navi/res/samples/test8sca.html +308 -0
- data/samples/navi/res/samples/test8siz.html +224 -0
- data/samples/navi/res/samples/test8tab.html +9 -0
- data/samples/navi/res/samples/test9.html +12 -0
- data/samples/navi/res/samples/test9a.html +39 -0
- data/samples/navi/res/samples/test9b.html +16 -0
- data/samples/navi/res/samples/test_ed.html +5 -0
- data/samples/navi/res/samples/test_form.html +34 -0
- data/samples/navi/res/samples/test_gfx.html +75 -0
- data/samples/navi/res/samples/test_lbox.html +100 -0
- data/samples/navi/res/samples/test_pr.html +87 -0
- data/samples/navi/res/samples/test_weight.html +45 -0
- data/samples/navi/res/samples/toolbarTest1.xul +51 -0
- data/samples/navi/res/samples/treeTest1.css +62 -0
- data/samples/navi/res/samples/treeTest1.xul +110 -0
- data/samples/navi/res/samples/xulTest.css +130 -0
- data/samples/navi/res/svg.css +64 -0
- data/samples/navi/res/table-add-column-after-active.gif +0 -0
- data/samples/navi/res/table-add-column-after-hover.gif +0 -0
- data/samples/navi/res/table-add-column-after.gif +0 -0
- data/samples/navi/res/table-add-column-before-active.gif +0 -0
- data/samples/navi/res/table-add-column-before-hover.gif +0 -0
- data/samples/navi/res/table-add-column-before.gif +0 -0
- data/samples/navi/res/table-add-row-after-active.gif +0 -0
- data/samples/navi/res/table-add-row-after-hover.gif +0 -0
- data/samples/navi/res/table-add-row-after.gif +0 -0
- data/samples/navi/res/table-add-row-before-active.gif +0 -0
- data/samples/navi/res/table-add-row-before-hover.gif +0 -0
- data/samples/navi/res/table-add-row-before.gif +0 -0
- data/samples/navi/res/table-remove-column-active.gif +0 -0
- data/samples/navi/res/table-remove-column-hover.gif +0 -0
- data/samples/navi/res/table-remove-column.gif +0 -0
- data/samples/navi/res/table-remove-row-active.gif +0 -0
- data/samples/navi/res/table-remove-row-hover.gif +0 -0
- data/samples/navi/res/table-remove-row.gif +0 -0
- data/samples/navi/res/throbber/Thumbs.db +0 -0
- data/samples/navi/res/throbber/anim.gif +0 -0
- data/samples/navi/res/throbber/anims00.gif +0 -0
- data/samples/navi/res/throbber/anims01.gif +0 -0
- data/samples/navi/res/throbber/anims02.gif +0 -0
- data/samples/navi/res/throbber/anims03.gif +0 -0
- data/samples/navi/res/throbber/anims04.gif +0 -0
- data/samples/navi/res/throbber/anims05.gif +0 -0
- data/samples/navi/res/throbber/anims06.gif +0 -0
- data/samples/navi/res/throbber/anims07.gif +0 -0
- data/samples/navi/res/throbber/anims08.gif +0 -0
- data/samples/navi/res/throbber/anims09.gif +0 -0
- data/samples/navi/res/throbber/anims10.gif +0 -0
- data/samples/navi/res/throbber/anims11.gif +0 -0
- data/samples/navi/res/throbber/anims12.gif +0 -0
- data/samples/navi/res/throbber/anims13.gif +0 -0
- data/samples/navi/res/throbber/anims14.gif +0 -0
- data/samples/navi/res/throbber/anims15.gif +0 -0
- data/samples/navi/res/throbber/anims16.gif +0 -0
- data/samples/navi/res/throbber/anims17.gif +0 -0
- data/samples/navi/res/throbber/anims18.gif +0 -0
- data/samples/navi/res/throbber/anims19.gif +0 -0
- data/samples/navi/res/throbber/anims20.gif +0 -0
- data/samples/navi/res/throbber/anims21.gif +0 -0
- data/samples/navi/res/throbber/anims22.gif +0 -0
- data/samples/navi/res/throbber/anims23.gif +0 -0
- data/samples/navi/res/throbber/anims24.gif +0 -0
- data/samples/navi/res/throbber/anims25.gif +0 -0
- data/samples/navi/res/throbber/anims26.gif +0 -0
- data/samples/navi/res/throbber/anims27.gif +0 -0
- data/samples/navi/res/throbber/anims28.gif +0 -0
- data/samples/navi/res/throbber/anims29.gif +0 -0
- data/samples/navi/res/ua.css +235 -0
- data/samples/navi/res/viewer.properties +1 -0
- data/samples/navi/res/viewsource.css +118 -0
- data/samples/navi/res/wincharset.properties +55 -0
- data/samples/navi/resources.cfg +14 -0
- data/samples/navi/testNaviMask.png +0 -0
- data/samples/ogre.cfg +8 -0
- data/samples/plugins.cfg +11 -0
- data/samples/quake3settings.cfg +2 -0
- data/samples/render_run_log.5796 +891 -0
- data/samples/render_to_texture.rb +161 -0
- data/samples/resources.cfg +16 -0
- data/samples/sky_box.rb +107 -0
- data/samples/sky_dome.rb +86 -0
- data/samples/sky_plane.rb +27 -0
- data/samples/smoke.rb +23 -0
- data/samples/work/cube_mapping.rb +686 -0
- metadata +500 -0
data/samples/lighting.rb
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
|
3
|
+
$: << File.dirname(__FILE__) + "/.."
|
4
|
+
require 'ogre'
|
5
|
+
require 'application'
|
6
|
+
include Ogre
|
7
|
+
|
8
|
+
$animation_state_list = []
|
9
|
+
|
10
|
+
class LightingListener < ApplicationFrameListener
|
11
|
+
def frame_started(event)
|
12
|
+
return false unless super(event)
|
13
|
+
|
14
|
+
$animation_state_list.each do |anim|
|
15
|
+
anim.add_time(event.time_since_last_frame)
|
16
|
+
end
|
17
|
+
|
18
|
+
true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class LightingApplication < Application
|
23
|
+
|
24
|
+
def create_scene
|
25
|
+
scene_manager.set_ambient_light ColourValue.new(0.5, 0.5, 0.5)
|
26
|
+
scene_manager.set_sky_box(true, "SpaceSkyBox")
|
27
|
+
head = scene_manager.create_entity("head", "ogrehead.mesh")
|
28
|
+
|
29
|
+
scene_manager.root_scene_node.attach_object(head)
|
30
|
+
|
31
|
+
## Set up light ribbons
|
32
|
+
dir = Vector3.new(-1, -1, 0.5)
|
33
|
+
dir.normalise!
|
34
|
+
|
35
|
+
l = scene_manager.create_light("light1")
|
36
|
+
l.set_type Light::LT_DIRECTIONAL
|
37
|
+
l.set_direction dir
|
38
|
+
|
39
|
+
trail = scene_manager.create_movable_object("RibbonTrail1", "RibbonTrail",
|
40
|
+
{"numberOfChains" => "2", "maxElements" => "80"})
|
41
|
+
trail.set_material_name "LightRibbonTrail"
|
42
|
+
trail.set_trail_length 400
|
43
|
+
|
44
|
+
puts trail
|
45
|
+
|
46
|
+
scene_manager.root_scene_node.create_child_scene_node.attach_object(trail)
|
47
|
+
|
48
|
+
anim_node = scene_manager.root_scene_node.create_child_scene_node
|
49
|
+
anim_node.set_position Vector3.new(50,30,0)
|
50
|
+
anim = scene_manager.create_animation("an1", 14)
|
51
|
+
anim.set_interpolation_mode Animation::IM_SPLINE
|
52
|
+
track = anim.create_node_track(1, anim_node)
|
53
|
+
kf = track.create_node_key_frame(0)
|
54
|
+
kf.set_translate Vector3.new(50,30,0)
|
55
|
+
kf = track.create_node_key_frame(2)
|
56
|
+
kf.set_translate Vector3.new(100, -30, 0)
|
57
|
+
kf = track.create_node_key_frame(4)
|
58
|
+
kf.set_translate Vector3.new(120, -100, 150)
|
59
|
+
kf = track.create_node_key_frame(6)
|
60
|
+
kf.set_translate Vector3.new(30, -100, 50)
|
61
|
+
kf = track.create_node_key_frame(8)
|
62
|
+
kf.set_translate Vector3.new(-50, 30, -50)
|
63
|
+
kf = track.create_node_key_frame(10)
|
64
|
+
kf.set_translate Vector3.new(-150, -20, -100)
|
65
|
+
kf = track.create_node_key_frame(12)
|
66
|
+
kf.set_translate Vector3.new(-50, -30, 0)
|
67
|
+
kf = track.create_node_key_frame(14)
|
68
|
+
kf.set_translate Vector3.new(50,30,0)
|
69
|
+
|
70
|
+
anim_state = scene_manager.create_animation_state("an1")
|
71
|
+
anim_state.set_enabled true
|
72
|
+
$animation_state_list << anim_state
|
73
|
+
|
74
|
+
trail.set_initial_colour(0, 1.0, 0.8, 0)
|
75
|
+
trail.set_colour_change(0, 0.5, 0.5, 0.5, 0.5)
|
76
|
+
trail.set_initial_width(0, 5)
|
77
|
+
trail.add_node(anim_node)
|
78
|
+
|
79
|
+
# Add light
|
80
|
+
l2 = scene_manager.create_light("l2")
|
81
|
+
l2.set_diffuse_colour trail.get_initial_colour(0)
|
82
|
+
anim_node.attach_object(l2)
|
83
|
+
|
84
|
+
# Add billboard
|
85
|
+
bbs = scene_manager.create_billboard_set("bb", 1)
|
86
|
+
bbs.create_billboard(Vector3.ZERO, trail.get_initial_colour(0))
|
87
|
+
bbs.set_material_name "Flare"
|
88
|
+
anim_node.attach_object(bbs)
|
89
|
+
|
90
|
+
anim_node = scene_manager.root_scene_node.create_child_scene_node
|
91
|
+
anim_node.set_position Vector3.new(-50,100,0)
|
92
|
+
anim = scene_manager.create_animation("an2", 10)
|
93
|
+
anim.set_interpolation_mode Animation::IM_SPLINE
|
94
|
+
track = anim.create_node_track(1, anim_node)
|
95
|
+
kf = track.create_node_key_frame(0)
|
96
|
+
kf.set_translate Vector3.new(-50,100,0)
|
97
|
+
kf = track.create_node_key_frame(2)
|
98
|
+
kf.set_translate Vector3.new(-100, 150, -30)
|
99
|
+
kf = track.create_node_key_frame(4)
|
100
|
+
kf.set_translate Vector3.new(-200, 0, 40)
|
101
|
+
kf = track.create_node_key_frame(6)
|
102
|
+
kf.set_translate Vector3.new(0, -150, 70)
|
103
|
+
kf = track.create_node_key_frame(8)
|
104
|
+
kf.set_translate Vector3.new(50, 0, 30)
|
105
|
+
kf = track.create_node_key_frame(10)
|
106
|
+
kf.set_translate Vector3.new(-50,100,0)
|
107
|
+
|
108
|
+
anim_state = scene_manager.create_animation_state("an2")
|
109
|
+
anim_state.set_enabled true
|
110
|
+
$animation_state_list << anim_state
|
111
|
+
|
112
|
+
trail.set_initial_colour(1, 0.0, 1.0, 0.4)
|
113
|
+
trail.set_colour_change(1, 0.5, 0.5, 0.5, 0.5)
|
114
|
+
trail.set_initial_width(1, 5)
|
115
|
+
trail.add_node(anim_node)
|
116
|
+
|
117
|
+
|
118
|
+
# Add light
|
119
|
+
l2 = scene_manager.create_light("l3")
|
120
|
+
l2.set_diffuse_colour trail.get_initial_colour(1)
|
121
|
+
anim_node.attach_object(l2)
|
122
|
+
|
123
|
+
# Add billboard
|
124
|
+
bbs = scene_manager.create_billboard_set("bb2", 1)
|
125
|
+
bbs.create_billboard(Vector3.ZERO, trail.get_initial_colour(1))
|
126
|
+
bbs.set_material_name "Flare"
|
127
|
+
anim_node.attach_object(bbs)
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
def create_frame_listener
|
132
|
+
self.frame_listener = LightingListener.new(root, window, camera)
|
133
|
+
#root.addFrameListener(self.frame_listener)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
app = LightingApplication.new
|
138
|
+
app.go
|
@@ -0,0 +1,30 @@
|
|
1
|
+
// Vertex program to wave some grass about
|
2
|
+
// Simplistic, assumes base of the grass at 0
|
3
|
+
void grass_vp(float4 position : POSITION,
|
4
|
+
float3 normal : NORMAL,
|
5
|
+
float2 uv : TEXCOORD0,
|
6
|
+
out float4 oPosition : POSITION,
|
7
|
+
out float2 oUv : TEXCOORD0,
|
8
|
+
out float4 colour : COLOR,
|
9
|
+
|
10
|
+
uniform float4x4 worldViewProj,
|
11
|
+
uniform float4 ambient,
|
12
|
+
uniform float4 objSpaceLight,
|
13
|
+
uniform float4 lightColour,
|
14
|
+
uniform float4 offset)
|
15
|
+
{
|
16
|
+
float4 mypos = position;
|
17
|
+
//offset = float4(0.5, 0, 0, 0);
|
18
|
+
mypos = mypos + offset * mypos.yyyy;
|
19
|
+
oPosition = mul(worldViewProj, mypos);
|
20
|
+
|
21
|
+
oUv = uv;
|
22
|
+
// get vertex light direction (support directional and point)
|
23
|
+
float3 light = normalize(
|
24
|
+
objSpaceLight.xyz - (position.xyz * objSpaceLight.w));
|
25
|
+
float diffuseFactor = max(dot(normal, light), 0);
|
26
|
+
|
27
|
+
|
28
|
+
colour = ambient + diffuseFactor * lightColour;
|
29
|
+
}
|
30
|
+
|
@@ -0,0 +1,97 @@
|
|
1
|
+
/* Bump mapping with Parallax offset vertex program
|
2
|
+
In this program, we want to calculate the tangent space light end eye vectors
|
3
|
+
which will get passed to the fragment program to produce the per-pixel bump map
|
4
|
+
with parallax offset effect.
|
5
|
+
*/
|
6
|
+
|
7
|
+
/* Vertex program that moves light and eye vectors into texture tangent space at vertex */
|
8
|
+
|
9
|
+
void main_vp(float4 position : POSITION,
|
10
|
+
float3 normal : NORMAL,
|
11
|
+
float2 uv : TEXCOORD0,
|
12
|
+
float3 tangent : TANGENT0,
|
13
|
+
// outputs
|
14
|
+
out float4 oPosition : POSITION,
|
15
|
+
out float2 oUv : TEXCOORD0,
|
16
|
+
out float3 oLightDir : TEXCOORD1, // tangent space
|
17
|
+
out float3 oEyeDir : TEXCOORD2, // tangent space
|
18
|
+
out float3 oHalfAngle : TEXCOORD3, //
|
19
|
+
// parameters
|
20
|
+
uniform float4 lightPosition, // object space
|
21
|
+
uniform float3 eyePosition, // object space
|
22
|
+
uniform float4x4 worldViewProj)
|
23
|
+
{
|
24
|
+
// calculate output position
|
25
|
+
oPosition = mul(worldViewProj, position);
|
26
|
+
|
27
|
+
// pass the main uvs straight through unchanged
|
28
|
+
oUv = uv;
|
29
|
+
|
30
|
+
// calculate tangent space light vector
|
31
|
+
// Get object space light direction
|
32
|
+
float3 lightDir = normalize(lightPosition.xyz - (position * lightPosition.w));
|
33
|
+
float3 eyeDir = eyePosition - position.xyz;
|
34
|
+
|
35
|
+
// Calculate the binormal (NB we assume both normal and tangent are
|
36
|
+
// already normalised)
|
37
|
+
// NB looks like nvidia cross params are BACKWARDS to what you'd expect
|
38
|
+
// this equates to NxT, not TxN
|
39
|
+
float3 binormal = cross(tangent, normal);
|
40
|
+
|
41
|
+
// Form a rotation matrix out of the vectors
|
42
|
+
float3x3 rotation = float3x3(tangent, binormal, normal);
|
43
|
+
|
44
|
+
// Transform the light vector according to this matrix
|
45
|
+
lightDir = normalize(mul(rotation, lightDir));
|
46
|
+
eyeDir = normalize(mul(rotation, eyeDir));
|
47
|
+
|
48
|
+
oLightDir = lightDir;
|
49
|
+
oEyeDir = eyeDir;
|
50
|
+
oHalfAngle = normalize(eyeDir + lightDir);
|
51
|
+
}
|
52
|
+
|
53
|
+
// General functions
|
54
|
+
|
55
|
+
// Expand a range-compressed vector
|
56
|
+
float3 expand(float3 v)
|
57
|
+
{
|
58
|
+
return (v - 0.5) * 2;
|
59
|
+
}
|
60
|
+
|
61
|
+
void main_fp(float2 uv : TEXCOORD0,
|
62
|
+
float3 lightDir : TEXCOORD1,
|
63
|
+
float3 eyeDir : TEXCOORD2,
|
64
|
+
float3 halfAngle : TEXCOORD3,
|
65
|
+
uniform float3 lightDiffuse,
|
66
|
+
uniform float3 lightSpecular,
|
67
|
+
uniform float4 scaleBias,
|
68
|
+
uniform sampler2D normalHeightMap,
|
69
|
+
uniform sampler2D diffuseMap,
|
70
|
+
out float4 oColor : COLOR)
|
71
|
+
{
|
72
|
+
// get the height using the tex coords
|
73
|
+
float height = tex2D(normalHeightMap, uv).a;
|
74
|
+
|
75
|
+
// scale and bias factors
|
76
|
+
float scale = scaleBias.x;
|
77
|
+
float bias = scaleBias.y;
|
78
|
+
|
79
|
+
// calculate displacement
|
80
|
+
float displacement = (height * scale) + bias;
|
81
|
+
|
82
|
+
float3 uv2 = float3(uv, 1);
|
83
|
+
|
84
|
+
// calculate the new tex coord to use for normal and diffuse
|
85
|
+
float2 newTexCoord = ((eyeDir * displacement) + uv2).xy;
|
86
|
+
|
87
|
+
// get the new normal and diffuse values
|
88
|
+
float3 normal = expand(tex2D(normalHeightMap, newTexCoord).xyz);
|
89
|
+
float3 diffuse = tex2D(diffuseMap, newTexCoord).xyz;
|
90
|
+
|
91
|
+
float3 specular = pow(saturate(dot(normal, halfAngle)), 32) * lightSpecular;
|
92
|
+
float3 col = diffuse * saturate(dot(normal, lightDir)) * lightDiffuse + specular;
|
93
|
+
|
94
|
+
oColor = float4(col, 1);
|
95
|
+
}
|
96
|
+
|
97
|
+
|
@@ -0,0 +1,135 @@
|
|
1
|
+
/* Offset mapping including a shadow element and multiple lights in one pass */
|
2
|
+
void integratedshadows_vp(float4 position : POSITION,
|
3
|
+
float3 normal : NORMAL,
|
4
|
+
float2 uv : TEXCOORD0,
|
5
|
+
float3 tangent : TANGENT0,
|
6
|
+
// outputs
|
7
|
+
out float4 oPosition : POSITION,
|
8
|
+
out float2 oUv : TEXCOORD0,
|
9
|
+
out float3 oLightDir : TEXCOORD1, // tangent space
|
10
|
+
out float3 oEyeDir : TEXCOORD2, // tangent space
|
11
|
+
out float3 oSpotDirection : TEXCOORD3, // tangent space
|
12
|
+
out float3 oLightDir1 : TEXCOORD4, // tangent space
|
13
|
+
out float3 oSpotDirection1 : TEXCOORD5, // tangent space
|
14
|
+
out float4 oShadowUV1 : TEXCOORD6,
|
15
|
+
out float4 oShadowUV2 : TEXCOORD7,
|
16
|
+
// parameters
|
17
|
+
uniform float4 lightPosition, // object space
|
18
|
+
uniform float4 lightPosition1, // object space
|
19
|
+
uniform float3 eyePosition, // object space
|
20
|
+
uniform float3 spotDirection, // object space
|
21
|
+
uniform float3 spotDirection1, // object space
|
22
|
+
uniform float4x4 worldViewProj,
|
23
|
+
uniform float4x4 worldMatrix,
|
24
|
+
uniform float4x4 texViewProj1,
|
25
|
+
uniform float4x4 texViewProj2)
|
26
|
+
{
|
27
|
+
// calculate output position
|
28
|
+
oPosition = mul(worldViewProj, position);
|
29
|
+
|
30
|
+
float4 worldPos = mul(worldMatrix, position);
|
31
|
+
oShadowUV1 = mul(texViewProj1, worldPos);
|
32
|
+
oShadowUV2 = mul(texViewProj2, worldPos);
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
// pass the main uvs straight through unchanged
|
37
|
+
oUv = uv;
|
38
|
+
|
39
|
+
// calculate tangent space light vector
|
40
|
+
// Get object space light direction
|
41
|
+
float3 lightDir = normalize(lightPosition.xyz - (position * lightPosition.w));
|
42
|
+
float3 lightDir1 = normalize(lightPosition1.xyz - (position * lightPosition1.w));
|
43
|
+
float3 eyeDir = eyePosition - position.xyz;
|
44
|
+
|
45
|
+
// Calculate the binormal (NB we assume both normal and tangent are
|
46
|
+
// already normalised)
|
47
|
+
// NB looks like nvidia cross params are BACKWARDS to what you'd expect
|
48
|
+
// this equates to NxT, not TxN
|
49
|
+
float3 binormal = cross(tangent, normal);
|
50
|
+
|
51
|
+
// Form a rotation matrix out of the vectors
|
52
|
+
float3x3 rotation = float3x3(tangent, binormal, normal);
|
53
|
+
|
54
|
+
// Transform the light vector according to this matrix
|
55
|
+
lightDir = normalize(mul(rotation, lightDir));
|
56
|
+
lightDir1 = normalize(mul(rotation, lightDir1));
|
57
|
+
eyeDir = normalize(mul(rotation, eyeDir));
|
58
|
+
|
59
|
+
oLightDir = lightDir;
|
60
|
+
oLightDir1 = lightDir1;
|
61
|
+
oEyeDir = eyeDir;
|
62
|
+
oSpotDirection = normalize(mul(rotation, -spotDirection));
|
63
|
+
oSpotDirection1 = normalize(mul(rotation, -spotDirection1));
|
64
|
+
}
|
65
|
+
|
66
|
+
// Expand a range-compressed vector
|
67
|
+
float3 expand(float3 v)
|
68
|
+
{
|
69
|
+
return (v - 0.5) * 2;
|
70
|
+
}
|
71
|
+
|
72
|
+
void integratedshadows_fp(
|
73
|
+
float2 uv : TEXCOORD0,
|
74
|
+
float3 lightDir : TEXCOORD1,
|
75
|
+
float3 eyeDir : TEXCOORD2,
|
76
|
+
float3 spotDir : TEXCOORD3,
|
77
|
+
float3 lightDir1 : TEXCOORD4,
|
78
|
+
float3 spotDir1 : TEXCOORD5,
|
79
|
+
float4 shadowUV1 : TEXCOORD6,
|
80
|
+
float4 shadowUV2 : TEXCOORD7,
|
81
|
+
uniform float3 lightDiffuse,
|
82
|
+
uniform float4 scaleBias,
|
83
|
+
uniform float4 spotParams,
|
84
|
+
uniform float3 lightDiffuse1,
|
85
|
+
uniform float4 spotParams1,
|
86
|
+
uniform sampler2D normalHeightMap : register(s0),
|
87
|
+
uniform sampler2D diffuseMap : register(s1),
|
88
|
+
uniform sampler2D shadowMap1 : register(s2),
|
89
|
+
uniform sampler2D shadowMap2 : register(s3),
|
90
|
+
out float4 oColour : COLOR)
|
91
|
+
{
|
92
|
+
// get the height using the tex coords
|
93
|
+
float height = tex2D(normalHeightMap, uv).a;
|
94
|
+
|
95
|
+
// scale and bias factors
|
96
|
+
float scale = scaleBias.x;
|
97
|
+
float bias = scaleBias.y;
|
98
|
+
|
99
|
+
// calculate displacement
|
100
|
+
float displacement = (height * scale) + bias;
|
101
|
+
|
102
|
+
float3 uv2 = float3(uv, 1);
|
103
|
+
|
104
|
+
float3 scaledEyeDir = eyeDir * displacement;
|
105
|
+
|
106
|
+
// calculate the new tex coord to use for normal and diffuse
|
107
|
+
float2 newTexCoord = (scaledEyeDir + uv2).xy;
|
108
|
+
|
109
|
+
// get the new normal and diffuse values
|
110
|
+
float3 normal = expand(tex2D(normalHeightMap, newTexCoord).xyz);
|
111
|
+
float3 diffuse = tex2D(diffuseMap, newTexCoord).xyz;
|
112
|
+
|
113
|
+
float3 col1 = diffuse * saturate(dot(normal, lightDir)) * lightDiffuse;
|
114
|
+
// factor in spotlight angle
|
115
|
+
float rho = saturate(dot(spotDir, lightDir));
|
116
|
+
// factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff
|
117
|
+
float spotFactor = pow(
|
118
|
+
saturate(rho - spotParams.y) / (spotParams.x - spotParams.y), spotParams.z);
|
119
|
+
col1 = col1 * spotFactor;
|
120
|
+
float3 col2 = diffuse * saturate(dot(normal, lightDir1)) * lightDiffuse1;
|
121
|
+
// factor in spotlight angle
|
122
|
+
rho = saturate(dot(spotDir1, lightDir1));
|
123
|
+
// factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff
|
124
|
+
spotFactor = pow(
|
125
|
+
saturate(rho - spotParams1.y) / (spotParams1.x - spotParams1.y), spotParams1.z);
|
126
|
+
col2 = col2 * spotFactor;
|
127
|
+
|
128
|
+
// shadow textures
|
129
|
+
col1 = col1 * tex2Dproj(shadowMap1, shadowUV1);
|
130
|
+
col2 = col2 * tex2Dproj(shadowMap2, shadowUV2);
|
131
|
+
|
132
|
+
oColour = float4(col1 + col2, 1);
|
133
|
+
|
134
|
+
}
|
135
|
+
|
@@ -0,0 +1,69 @@
|
|
1
|
+
uniform vec4 lightDiffuse;
|
2
|
+
uniform vec4 scaleBias;
|
3
|
+
uniform vec4 spotParams;
|
4
|
+
uniform vec4 lightDiffuse1;
|
5
|
+
uniform vec4 spotParams1;
|
6
|
+
|
7
|
+
uniform sampler2D normalHeightMap;
|
8
|
+
uniform sampler2D diffuseMap;
|
9
|
+
uniform sampler2D shadowMap1;
|
10
|
+
uniform sampler2D shadowMap2;
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
varying vec3 tangentEyeDir;
|
15
|
+
varying vec3 tangentLightDir[2];
|
16
|
+
varying vec3 tangentSpotDir[2];
|
17
|
+
varying vec4 shadowUV[2];
|
18
|
+
|
19
|
+
|
20
|
+
// Expand a range-compressed vector
|
21
|
+
vec3 expand(vec3 v)
|
22
|
+
{
|
23
|
+
return (v - 0.5) * 2.0;
|
24
|
+
}
|
25
|
+
|
26
|
+
|
27
|
+
void main()
|
28
|
+
{
|
29
|
+
// get the height using the tex coords
|
30
|
+
float height = texture2D(normalHeightMap, gl_TexCoord[0].xy).a;
|
31
|
+
// scale and bias factors
|
32
|
+
float scale = scaleBias.x;
|
33
|
+
float bias = scaleBias.y;
|
34
|
+
|
35
|
+
// calculate displacement
|
36
|
+
float displacement = (height * scale) + bias;
|
37
|
+
//float displacement = (height * 0.04) - 0.02;
|
38
|
+
|
39
|
+
vec3 scaledEyeDir = tangentEyeDir * displacement;
|
40
|
+
|
41
|
+
// calculate the new tex coord to use for normal and diffuse
|
42
|
+
vec2 newTexCoord = (scaledEyeDir + gl_TexCoord[0].xyz).xy;
|
43
|
+
|
44
|
+
// get the new normal and diffuse values
|
45
|
+
vec3 normal = expand(texture2D(normalHeightMap, newTexCoord).xyz);
|
46
|
+
vec4 diffuse = texture2D(diffuseMap, newTexCoord);
|
47
|
+
|
48
|
+
vec4 col1 = diffuse * clamp(dot(normal, tangentLightDir[0]),0.0,1.0) * lightDiffuse;
|
49
|
+
// factor in spotlight angle
|
50
|
+
float rho = clamp(dot(tangentSpotDir[0], tangentLightDir[0]),0.0,1.0);
|
51
|
+
// factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff
|
52
|
+
float spotFactor = pow(
|
53
|
+
clamp(rho - spotParams.y,0.0,1.0) / (spotParams.x - spotParams.y), spotParams.z);
|
54
|
+
col1 = col1 * spotFactor;
|
55
|
+
vec4 col2 = diffuse * clamp(dot(normal, tangentLightDir[1]),0.0,1.0) * lightDiffuse1;
|
56
|
+
// factor in spotlight angle
|
57
|
+
rho = clamp(dot(tangentSpotDir[1], tangentLightDir[1]),0.0,1.0);
|
58
|
+
// factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff
|
59
|
+
spotFactor = pow(
|
60
|
+
clamp(rho - spotParams1.y,0.0,1.0) / (spotParams1.x - spotParams1.y), spotParams1.z);
|
61
|
+
col2 = col2 * spotFactor;
|
62
|
+
|
63
|
+
// shadow textures
|
64
|
+
col1 = col1 * texture2DProj(shadowMap1, shadowUV[0]);
|
65
|
+
col2 = col2 * texture2DProj(shadowMap2, shadowUV[1]);
|
66
|
+
|
67
|
+
gl_FragColor = col1 + col2;
|
68
|
+
|
69
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
attribute vec3 tangent;
|
2
|
+
|
3
|
+
uniform vec4 lightPosition; // object space
|
4
|
+
uniform vec4 lightPosition1; // object space
|
5
|
+
uniform vec4 eyePosition; // object space
|
6
|
+
uniform vec4 spotDirection; // object space
|
7
|
+
uniform vec4 spotDirection1; // object space
|
8
|
+
uniform mat4 worldViewProj; // not actually used but here for compat with HLSL
|
9
|
+
uniform mat4 worldMatrix;
|
10
|
+
uniform mat4 texViewProj1;
|
11
|
+
uniform mat4 texViewProj2;
|
12
|
+
|
13
|
+
|
14
|
+
varying vec3 tangentEyeDir;
|
15
|
+
varying vec3 tangentLightDir[2];
|
16
|
+
varying vec3 tangentSpotDir[2];
|
17
|
+
varying vec4 shadowUV[2];
|
18
|
+
|
19
|
+
void main()
|
20
|
+
{
|
21
|
+
gl_Position = ftransform();
|
22
|
+
|
23
|
+
vec4 worldPos = worldMatrix * gl_Vertex;
|
24
|
+
|
25
|
+
shadowUV[0] = texViewProj1 * worldPos;
|
26
|
+
shadowUV[1] = texViewProj2 * worldPos;
|
27
|
+
|
28
|
+
// pass the main uvs straight through unchanged
|
29
|
+
gl_TexCoord[0] = gl_MultiTexCoord0;
|
30
|
+
|
31
|
+
// calculate tangent space light vector
|
32
|
+
// Get object space light direction
|
33
|
+
vec3 lightDir = normalize(lightPosition.xyz - (gl_Vertex.xyz * lightPosition.w));
|
34
|
+
vec3 lightDir1 = normalize(lightPosition1.xyz - (gl_Vertex.xyz * lightPosition1.w));
|
35
|
+
|
36
|
+
vec3 eyeDir = (eyePosition - gl_Vertex).xyz;
|
37
|
+
|
38
|
+
// Calculate the binormal (NB we assume both normal and tangent are
|
39
|
+
// already normalised)
|
40
|
+
vec3 binormal = cross(gl_Normal, tangent);
|
41
|
+
|
42
|
+
// Form a rotation matrix out of the vectors
|
43
|
+
mat3 rotation = mat3(tangent, binormal, gl_Normal);
|
44
|
+
|
45
|
+
// Transform the light vector according to this matrix
|
46
|
+
tangentLightDir[0] = normalize(rotation * lightDir);
|
47
|
+
tangentLightDir[1] = normalize(rotation * lightDir1);
|
48
|
+
// Invert the Y on the eye dir since we'll be using this to alter UVs and
|
49
|
+
// GL has Y inverted
|
50
|
+
tangentEyeDir = normalize(rotation * eyeDir) * vec3(1, -1, 1);
|
51
|
+
|
52
|
+
tangentSpotDir[0] = normalize(rotation * -spotDirection.xyz);
|
53
|
+
tangentSpotDir[1] = normalize(rotation * -spotDirection1.xyz);
|
54
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
// Pixel Shader for doing bump mapping with parallax plus diffuse and specular lighting by nfz
|
2
|
+
|
3
|
+
// uv TEXCOORD0
|
4
|
+
// lightDir TEXCOORD1
|
5
|
+
// eyeDir TEXCOORD2
|
6
|
+
// half TEXCOORD3
|
7
|
+
|
8
|
+
// lightDiffuse c0
|
9
|
+
// lightSpecular c1
|
10
|
+
// Parallax scale and bias c2
|
11
|
+
// normal/height map texunit 0 - height map in alpha channel
|
12
|
+
// diffuse texture texunit 1
|
13
|
+
|
14
|
+
ps.1.4
|
15
|
+
|
16
|
+
|
17
|
+
texld r0, t0 // get height
|
18
|
+
texcrd r2.xyz, t0 // get uv coordinates
|
19
|
+
texcrd r3.xyz, t2 // get eyedir vector
|
20
|
+
|
21
|
+
|
22
|
+
mad r0.xyz, r0.a, c2.x, c2.y // displacement = height * scale + bias
|
23
|
+
mad r2.xyz, r3, r0, r2 // newtexcoord = eyedir * displacement + uv
|
24
|
+
|
25
|
+
phase
|
26
|
+
|
27
|
+
texld r0, r2.xyz // get normal N using newtexcoord
|
28
|
+
texld r1, r2.xyz // get diffuse texture using newtexcoord
|
29
|
+
texcrd r4.xyz, t1 // get lightdir vector
|
30
|
+
texcrd r5.xyz, t3 // get half angle vector
|
31
|
+
|
32
|
+
dp3_sat r5.rgb, r0_bx2, r5 // N dot H - spec calc
|
33
|
+
dp3_sat r4.rgb, r0_bx2, r4 // N dot L - diffuse calc
|
34
|
+
+ mul r5.a, r5.r, r5.r
|
35
|
+
mul r0.rgb, r4, r1 // colour = diffusetex * N dot L
|
36
|
+
+ mul r5.a, r5.a, r5.a
|
37
|
+
|
38
|
+
mul r5.rgb, r5.a, r5.a
|
39
|
+
mul r5.rgb, r5, r5
|
40
|
+
mul r5.rgb, r5, r5
|
41
|
+
mul r5.rgb, r5, c1 // specular = (N dot H)^32 * specularlight
|
42
|
+
|
43
|
+
mad r0.rgb, r0, c0, r5 // colour = diffusetex * (N dot L)* diffuselight + specular
|
44
|
+
+ mov r0.a, c2.b
|
@@ -0,0 +1,34 @@
|
|
1
|
+
material SceneSkyBox2
|
2
|
+
{
|
3
|
+
technique
|
4
|
+
{
|
5
|
+
pass
|
6
|
+
{
|
7
|
+
lighting off
|
8
|
+
depth_write off
|
9
|
+
|
10
|
+
texture_unit
|
11
|
+
{
|
12
|
+
cubic_texture cubescene_fr.jpg cubescene_bk.jpg cubescene_lf.jpg cubescene_rt.jpg cubescene_up.jpg cubescene_dn.jpg separateUV
|
13
|
+
tex_address_mode clamp
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
material SceneCubeMap2
|
19
|
+
{
|
20
|
+
technique
|
21
|
+
{
|
22
|
+
pass
|
23
|
+
{
|
24
|
+
lighting off
|
25
|
+
|
26
|
+
texture_unit
|
27
|
+
{
|
28
|
+
cubic_texture cubescene.jpg combinedUVW
|
29
|
+
tex_address_mode clamp
|
30
|
+
env_map cubic_reflection
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|