├── README.md ├── backend ├── buildvc9 │ ├── luxcore │ │ └── luxcore.vcproj │ ├── luxmath │ │ └── luxmath.vcproj │ └── luxplatform │ │ └── luxplatform.vcproj ├── include │ └── luxinia │ │ ├── luxcore │ │ ├── arraymisc.h │ │ ├── containers.h │ │ ├── contbitarray.h │ │ ├── conthash.h │ │ ├── contmacrolinkedlist.h │ │ ├── contmap.h │ │ ├── contoctree.h │ │ ├── contscalararray.h │ │ ├── contstringmap.h │ │ ├── contstringmap.hpp │ │ ├── contvector.h │ │ ├── contvector.hpp │ │ ├── handlesys.h │ │ ├── luxcore.h │ │ ├── memory.h │ │ ├── memorybase.h │ │ ├── memorydlmalloc.h │ │ ├── memorygeneric.h │ │ ├── memorylist.h │ │ ├── memorypool.h │ │ ├── memorypool.hpp │ │ ├── memorystack.h │ │ ├── memorytlsf.h │ │ ├── refsys.h │ │ ├── refsys.hpp │ │ ├── scalarmisc.h │ │ ├── sortradix.h │ │ └── strmisc.h │ │ ├── luxmath │ │ ├── basetypes.h │ │ ├── basetypes.hpp │ │ ├── bounding.h │ │ ├── fastmath.h │ │ ├── float16.h │ │ ├── frustum.h │ │ ├── geometry.h │ │ ├── luxmath.h │ │ ├── matrix34.h │ │ ├── matrix44.h │ │ ├── misc.h │ │ ├── quaternion.h │ │ ├── simdmath.h │ │ ├── vector2.h │ │ ├── vector3.h │ │ ├── vector4.h │ │ └── xmmmath.h │ │ ├── luxplatform │ │ ├── debug.h │ │ ├── endian.h │ │ ├── file.h │ │ ├── luxconfig.h │ │ ├── luxplatform.h │ │ └── luxtypes.h │ │ └── luxscene │ │ ├── luxscene.h │ │ ├── mesh.h │ │ ├── meshbase.h │ │ └── meshvcacheopt.h ├── luxcore │ ├── arraymisc.cpp │ ├── cont_defs.h │ ├── contbitarray.c │ ├── conthash.c │ ├── contmap.c │ ├── contoctree.c │ ├── contscalararray.cpp │ ├── contstringmap.c │ ├── contvector.c │ ├── handlesys.c │ ├── memory_defs.h │ ├── memorybase.c │ ├── memorydlmalloc.c │ ├── memorygeneric.c │ ├── memorylist.c │ ├── memorypool.c │ ├── memorystack.c │ ├── memorytlsf.c │ ├── memorytlsfbits.h │ ├── refsys.c │ ├── sortradix.c │ └── strmisc.c ├── luxmath │ ├── bounding.c │ ├── fastmath.c │ ├── fastmathxmm.cpp │ ├── frustum.c │ ├── geometry.c │ ├── matrix34.c │ ├── matrix44.c │ ├── misc.c │ ├── quaternion.c │ ├── vector2.c │ ├── vector3.c │ ├── vector4.c │ └── xmmmath.c ├── luxplatform │ ├── file.c │ └── platform.c └── luxscene │ ├── meshbase.c │ ├── meshvcacheoptcastano.cpp │ ├── meshvcacheoptforsyth.cpp │ └── meshvcacheopttipsify.cpp ├── engine ├── base │ ├── gpuprogs │ │ ├── bump_posinv_lit1.vp │ │ ├── bump_posinv_lit2.vp │ │ ├── bump_posinv_lit3.vp │ │ ├── bump_posinv_lit4.vp │ │ ├── bump_posinv_unlit.vp │ │ ├── particle_batch.vp │ │ ├── particle_batch_lm.vp │ │ ├── particle_batch_rotated.vp │ │ ├── particle_batch_rotated_globalaxis.vp │ │ ├── particle_batch_rotated_globalaxis_lm.vp │ │ ├── particle_batch_rotated_lm.vp │ │ ├── particle_instance.vp │ │ ├── particle_instance_globalaxis.vp │ │ ├── particle_instance_globalaxis_lit.vp │ │ ├── particle_instance_globalaxis_lit_lm.vp │ │ ├── particle_instance_globalaxis_lm.vp │ │ ├── particle_instance_lit.vp │ │ ├── particle_instance_lit_lm.vp │ │ ├── particle_instance_lm.vp │ │ ├── projector.vp │ │ ├── skin_weight_lit1.vp │ │ ├── skin_weight_lit2.vp │ │ ├── skin_weight_lit3.vp │ │ ├── skin_weight_lit4.vp │ │ ├── skin_weight_unlit.vp │ │ └── texfilter │ │ │ ├── texfilter_frag1.glp │ │ │ ├── texfilter_frag1_rect.glp │ │ │ ├── texfilter_frag2.glp │ │ │ ├── texfilter_frag2_rect.glp │ │ │ ├── texfilter_frag3.glp │ │ │ ├── texfilter_frag3_rect.glp │ │ │ ├── texfilter_frag4.glp │ │ │ ├── texfilter_frag4_rect.glp │ │ │ ├── texfilter_frag5.glp │ │ │ ├── texfilter_frag5_rect.glp │ │ │ ├── texfilter_frag6.glp │ │ │ ├── texfilter_frag6_rect.glp │ │ │ ├── texfilter_frag7.glp │ │ │ ├── texfilter_frag7_rect.glp │ │ │ ├── texfilter_frag8.glp │ │ │ ├── texfilter_frag8_rect.glp │ │ │ ├── texfilter_frag9.glp │ │ │ ├── texfilter_frag9_rect.glp │ │ │ ├── texfilter_vert1.glp │ │ │ ├── texfilter_vert2.glp │ │ │ ├── texfilter_vert3.glp │ │ │ ├── texfilter_vert4.glp │ │ │ ├── texfilter_vert5.glp │ │ │ ├── texfilter_vert6.glp │ │ │ ├── texfilter_vert7.glp │ │ │ ├── texfilter_vert8.glp │ │ │ ├── texfilter_vert9.glp │ │ │ └── texfilter_vf.cg │ ├── main.lua │ ├── materials │ │ ├── texfilter1.mtl │ │ ├── texfilter2.mtl │ │ ├── texfilter3.mtl │ │ ├── texfilter4.mtl │ │ ├── texfilter5.mtl │ │ ├── texfilter6.mtl │ │ ├── texfilter7.mtl │ │ ├── texfilter8.mtl │ │ └── texfilter9.mtl │ ├── scripts │ │ ├── commandlineutil.lua │ │ ├── luxmodules │ │ │ ├── gui │ │ │ │ ├── Component.lua │ │ │ │ ├── Container.lua │ │ │ │ ├── Rectangle.lua │ │ │ │ ├── SkinnedImage.lua │ │ │ │ ├── components │ │ │ │ │ ├── Button.lua │ │ │ │ │ ├── Checkbox.lua │ │ │ │ │ ├── ComboBox.lua │ │ │ │ │ ├── ContainerMover.lua │ │ │ │ │ ├── ContainerResizer.lua │ │ │ │ │ ├── GroupFrame.lua │ │ │ │ │ ├── ImageComponent.lua │ │ │ │ │ ├── Label.lua │ │ │ │ │ ├── ListBox.lua │ │ │ │ │ ├── MultiLineLabel.lua │ │ │ │ │ ├── ScrollBar.lua │ │ │ │ │ ├── Slider.lua │ │ │ │ │ ├── TextArea.lua │ │ │ │ │ ├── TextField.lua │ │ │ │ │ ├── TreeView.lua │ │ │ │ │ ├── buttongroup.lua │ │ │ │ │ └── titleframe.lua │ │ │ │ ├── guihelpers.lua │ │ │ │ ├── icon.lua │ │ │ │ ├── imageicon.lua │ │ │ │ ├── l2dicon.lua │ │ │ │ ├── l3dicon.lua │ │ │ │ ├── mod_gui.lua │ │ │ │ ├── mouse.lua │ │ │ │ ├── skin2d.lua │ │ │ │ ├── stretchedimageskin.lua │ │ │ │ └── tooltipevent.lua │ │ │ ├── luxext │ │ │ │ ├── bit.lua │ │ │ │ ├── lua.lua │ │ │ │ ├── mod_luxext.lua │ │ │ │ └── net.lua │ │ │ ├── luxinialuacore │ │ │ │ ├── autodoc.lua │ │ │ │ ├── autotable.lua │ │ │ │ ├── cameractrl.lua │ │ │ │ ├── classinfo.lua │ │ │ │ ├── compat.lua │ │ │ │ ├── cyclicqueue.lua │ │ │ │ ├── debugoutput.lua │ │ │ │ ├── dreg.lua │ │ │ │ ├── filesystem.lua │ │ │ │ ├── fxutils.lua │ │ │ │ ├── grouparray.lua │ │ │ │ ├── hashspace.lua │ │ │ │ ├── keyboard.lua │ │ │ │ ├── luaconsole.lua │ │ │ │ ├── luxiniaparam.lua │ │ │ │ ├── math3d.lua │ │ │ │ ├── mod_luxinialuacore.lua │ │ │ │ ├── oo.lua │ │ │ │ ├── serializer.lua │ │ │ │ ├── timer.lua │ │ │ │ ├── utilfunctions.lua │ │ │ │ ├── vfs.lua │ │ │ │ ├── viewer.lua │ │ │ │ └── viewer_settings.lua │ │ │ └── modulekernel.lua │ │ └── projectmanager │ │ │ ├── .cvsignore │ │ │ ├── options.lua │ │ │ └── projectmanager.lua │ ├── shaders │ │ ├── texfilter1.shd │ │ ├── texfilter2.shd │ │ ├── texfilter3.shd │ │ ├── texfilter4.shd │ │ ├── texfilter5.shd │ │ ├── texfilter6.shd │ │ ├── texfilter7.shd │ │ ├── texfilter8.shd │ │ └── texfilter9.shd │ ├── skins │ │ ├── lux97.lua │ │ └── lux98.lua │ └── wxstartup.lua ├── include │ └── luxinia │ │ ├── luxinia.h │ │ ├── meshvertex.h │ │ ├── refclasses.h │ │ ├── reference.h │ │ └── reftypes.h └── source │ ├── buildvc9 │ └── luxinia.vcproj │ ├── common │ ├── 3dmath.c │ ├── 3dmath.h │ ├── common.h │ ├── console.c │ ├── console.h │ ├── interfaceobjects.c │ ├── interfaceobjects.h │ ├── interfaceobjectscom.h │ ├── linkedlistprimitives.c │ ├── linkedlistprimitives.h │ ├── memorymanager.c │ ├── memorymanager.h │ ├── mesh.c │ ├── mesh.h │ ├── miscstring.c │ ├── miscstring.h │ ├── perfgraph.c │ ├── perfgraph.h │ ├── profiling.c │ ├── profiling.h │ ├── reflib.c │ ├── reflib.h │ ├── timer.c │ ├── timer.h │ ├── types.h │ ├── vid.c │ ├── vid.h │ ├── vidbuffer.h │ └── vidinl.h │ ├── controls │ ├── controls.c │ └── controls.h │ ├── fileio │ ├── dds.c │ ├── dds.h │ ├── f3d.c │ ├── f3d.h │ ├── filesystem.c │ ├── filesystem.h │ ├── filesystemcrc32.h │ ├── jpg.c │ ├── jpg.h │ ├── log.c │ ├── log.h │ ├── ma.c │ ├── ma.h │ ├── mtl.c │ ├── mtl.h │ ├── parser.c │ ├── parser.h │ ├── png.c │ ├── png.h │ ├── prt.c │ ├── prt.h │ ├── shd.c │ ├── shd.h │ ├── tga.c │ └── tga.h │ ├── fnpublish │ ├── fnpublish.c │ ├── fnpublish.h │ ├── pubclass_actornode.c │ ├── pubclass_animation.c │ ├── pubclass_bone.c │ ├── pubclass_camera.c │ ├── pubclass_class.c │ ├── pubclass_collision.c │ ├── pubclass_collision.h │ ├── pubclass_console.c │ ├── pubclass_gpuprog.c │ ├── pubclass_input.c │ ├── pubclass_light.c │ ├── pubclass_list2d.c │ ├── pubclass_list3d.c │ ├── pubclass_list3dset.c │ ├── pubclass_material.c │ ├── pubclass_matrix.c │ ├── pubclass_model.c │ ├── pubclass_particle.c │ ├── pubclass_projector.c │ ├── pubclass_render.c │ ├── pubclass_scalararray.c │ ├── pubclass_scenetree.c │ ├── pubclass_shader.c │ ├── pubclass_skybox.c │ ├── pubclass_sound.c │ ├── pubclass_staticarray.c │ ├── pubclass_system.c │ ├── pubclass_test.c │ ├── pubclass_texture.c │ ├── pubclass_trail.c │ └── pubclass_types.h │ ├── luxinia.aps │ ├── luxinia.rc │ ├── luxinia_architecture.odg │ ├── luxinia_architecture.png │ ├── luxinia_architecture_t.png │ ├── luxinia_engine.txt │ ├── luxinia_log.txt │ ├── luxinia_mtlscript.md │ ├── luxinia_mtlscript.txt │ ├── luxinia_prtscript.md │ ├── luxinia_prtscript.txt │ ├── luxinia_shdscript.md │ ├── luxinia_shdscript.txt │ ├── main │ ├── luabitop.c │ ├── luacore.c │ ├── luacore.h │ ├── luxinia.c │ ├── main.c │ └── main.h │ ├── memstats.lua │ ├── render │ ├── gl_camlight.c │ ├── gl_camlight.h │ ├── gl_draw2d.c │ ├── gl_draw2d.h │ ├── gl_draw3d.c │ ├── gl_draw3d.h │ ├── gl_drawmesh.c │ ├── gl_drawmesh.h │ ├── gl_drawmeshinl.h │ ├── gl_list2d.c │ ├── gl_list2d.h │ ├── gl_list3d.c │ ├── gl_list3d.h │ ├── gl_list3dbatch.c │ ├── gl_list3dbatch.h │ ├── gl_list3ddraw.c │ ├── gl_list3dgeometry.c │ ├── gl_list3dgeometry.h │ ├── gl_particle.c │ ├── gl_particle.h │ ├── gl_print.c │ ├── gl_print.h │ ├── gl_render.c │ ├── gl_render.h │ ├── gl_shader.c │ ├── gl_shader.h │ ├── gl_trail.c │ ├── gl_trail.h │ ├── gl_window.c │ └── gl_window.h │ ├── resource │ ├── animation.c │ ├── animation.h │ ├── bone.c │ ├── bone.h │ ├── gpuprog.c │ ├── gpuprog.h │ ├── material.c │ ├── material.h │ ├── model.c │ ├── model.h │ ├── particle.c │ ├── particle.h │ ├── resmanager.c │ ├── resmanager.h │ ├── shader.c │ ├── shader.h │ ├── sound.c │ ├── sound.h │ ├── texture.c │ └── texture.h │ ├── scene │ ├── actorlist.c │ ├── actorlist.h │ ├── linkobject.h │ ├── scenetree.c │ ├── scenetree.h │ ├── vistest.c │ └── vistest.h │ ├── sound │ ├── musicfile.c │ ├── musicfile.h │ ├── soundlist.c │ └── soundlist.h │ └── version.h ├── frontends ├── luxinia_glfw │ ├── buildcb-gcc │ │ └── luxinia_glfw.cbp │ ├── buildvc9 │ │ └── luxinia_glfw.vcproj │ ├── include │ │ └── resourcecustom.h │ └── src │ │ └── luxinia_glfw.c ├── luxinia_lua │ ├── buildvc9 │ │ └── luxinia_lua.vcproj │ ├── include │ │ └── resourcecustom.h │ ├── luxinia_lua.txt │ └── src │ │ ├── frontend_bindings.c │ │ ├── frontend_bindings.h │ │ └── luxinia_lua.c └── shared │ ├── luastate.c │ ├── luastate.h │ ├── luxinia.ico │ ├── luxinia.rc │ ├── os.h │ ├── os_posixdebug.c │ ├── os_win32.cpp │ ├── os_win32debug.cpp │ ├── project.c │ ├── project.h │ ├── project_win32.cpp │ └── resource.h ├── projects └── tutorials │ ├── .projectinfo.lua │ ├── .thumbnail.png │ ├── fxs │ ├── particlesys │ │ ├── particle2quads.shd │ │ └── particlesys.cg │ ├── postfx │ │ ├── pfx_add2.mtl │ │ ├── pfx_add2.shd │ │ └── pfx_vf.cg │ └── volraycast │ │ ├── volfrontplane.mtl │ │ ├── volfrontplane.shd │ │ ├── volpos.cg │ │ ├── volpos.mtl │ │ ├── volpos.shd │ │ ├── volraycast.cg │ │ ├── volraycast.mtl │ │ └── volraycast.shd │ ├── gpuprogs │ ├── common.cg │ ├── localnormalmap.cg │ ├── simplelighting.cg │ ├── skyshader.cg │ ├── skyshader.cg.fragment_main^arbfp1.glp │ └── tangentnormalmap.cg │ ├── log.txt │ ├── main.lua │ ├── materials │ ├── chassis.mtl │ ├── leaves.jpg.mtl │ ├── senior.tga.mtl │ ├── sky.mtl │ ├── streetatlas.png.mtl │ └── t33.mtl │ ├── models │ ├── box.f3d │ ├── car.f3d │ ├── car_shadow.f3d │ ├── car_wheel_l.f3d │ ├── car_wheel_r.f3d │ ├── chiropteradm.f3d │ ├── enviro │ │ ├── baum.f3d │ │ ├── baum2.f3d │ │ ├── baum3.f3d │ │ ├── baum4.f3d │ │ ├── baum5.f3d │ │ ├── baum6.f3d │ │ ├── busch_inst1.f3d │ │ ├── busch_inst2.f3d │ │ ├── grass_inst1.f3d │ │ ├── grass_inst2.f3d │ │ ├── stein1.f3d │ │ ├── stein2.f3d │ │ ├── stein3.f3d │ │ ├── stein4.f3d │ │ ├── stein5.f3d │ │ └── stoneplate.f3d │ ├── lmbox.f3d │ ├── lmtree.f3d │ ├── mirroredlocalmap.f3d │ ├── scene.f3d │ ├── selector.f3d │ ├── senior.f3d │ ├── skydome.f3d │ └── t33.f3d │ ├── particles │ └── arrow.prt │ ├── plugins │ ├── cudatest.dll │ ├── cudatest │ │ ├── buildvc8 │ │ │ ├── Cuda.rules │ │ │ ├── cudatest.sln │ │ │ ├── cudatest.vcproj │ │ │ └── simpleGL_kernel.linkinfo │ │ ├── readme.txt │ │ └── src │ │ │ ├── simpleGL.cpp │ │ │ └── simpleGL_kernel.cu │ └── minimal │ │ ├── buildcb │ │ ├── minimal.cbp │ │ └── minimal.workspace │ │ ├── buildvc8 │ │ ├── minimal.sln │ │ └── minimal.vcproj │ │ └── src │ │ └── minimal.cpp │ ├── shaders │ ├── 1color_cubemapsky.shd │ ├── 3tex_diffspecillum.shd │ ├── alphatest.shd │ ├── normalmap_full.shd │ ├── normalmap_local.shd │ ├── normalmap_onlyspec.shd │ ├── ppl_color_spec.shd │ ├── shinyspecular.shd │ └── sky.shd │ ├── textures │ ├── Box01NormalsMap.tga │ ├── arrow.tga │ ├── buildblock1.jpg │ ├── carshadow.jpg │ ├── clouds.png │ ├── explosprite.png │ ├── grasstile.jpg │ ├── grastex1.tga │ ├── grastex2.tga │ ├── grastex3.tga │ ├── leaves.png │ ├── lightmap_chiropteradm_0.tga │ ├── lightmap_chiropteradm_1.tga │ ├── lightmap_chiropteradm_2.tga │ ├── senior.jpg │ ├── senior_ao.jpg │ ├── senior_localcombined.jpg │ ├── senior_s.jpg │ ├── skycolors.tga │ ├── stein.jpg │ ├── streetatlas.png │ ├── sun1.tga │ ├── t33comb.png │ ├── t33diff.png │ ├── t33illum.png │ ├── t33small.tga │ ├── t33spec.png │ ├── tech_01.jpg │ ├── tech_02.jpg │ ├── tech_03.jpg │ ├── tech_04.jpg │ ├── tree.jpg │ └── treeshadow.jpg │ ├── tutorial20-zip │ ├── main.lua │ ├── models │ │ └── t33.f3d │ ├── textures │ │ └── t33small.tga │ └── tutorial20-zip.zip │ ├── tutorials.png │ ├── tutorialstodo.txt │ └── tutscripts │ ├── Shared │ ├── advrendering.lua │ ├── camcontrols.lua │ └── htmllabels.lua │ ├── T002-basicscene.lua │ ├── T003-inputhandling.lua │ ├── T004-physics.lua │ ├── T005-vehicle.lua │ ├── T006-model.lua │ ├── T007-picking.lua │ ├── T009-udp_network.lua │ ├── T009 │ └── udp.lua │ ├── T012-tetrisattack.lua │ ├── T014-frustum_l3d.lua │ ├── T014-frustum_spatial.lua │ ├── T015-frontbackplane.lua │ ├── T016-physicsurface.lua │ ├── T017-stencil.lua │ ├── T018-dynamicmesh.lua │ ├── T019-sprite.lua │ ├── T022-shaders.lua │ ├── T023-materials.lua │ ├── T024-fboglowmrt.lua │ ├── T025-postfx.lua │ ├── T025 │ └── skyscene.lua │ ├── T026-scalararray.lua │ ├── T027-threads.lua │ ├── T028-levelmodel.lua │ ├── T028 │ └── q3test_index.html │ ├── T029-vehiclereflection.lua │ ├── T030-localnormalmap.lua │ ├── T031-2dphysics.lua │ ├── T032-usertextures.lua │ ├── T033-tangentnormalmap.lua │ ├── T034-staticparticles.lua │ ├── T035-trails.lua │ ├── T036-lightmapgen.lua │ ├── T037-usermeshvbo.lua │ ├── T038-cudaplugin.lua │ ├── T039-render2vbuffer.lua │ ├── T040-volumerender.lua │ └── T041-opencl.lua ├── solutions └── buildvc9 │ └── luxinia9.sln └── zbstudio-integration ├── api ├── cg │ └── stdlib.lua └── lua │ └── luxiniaapi.lua ├── interpreters └── luxinia.lua ├── spec └── cg.lua └── tools └── cg.lua /backend/include/luxinia/luxcore/arraymisc.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | 6 | #ifndef __LUXCORE_ARRAYMISC_H__ 7 | #define __LUXCORE_ARRAYMISC_H__ 8 | 9 | #include 10 | 11 | #ifdef __cplusplus 12 | extern "C"{ 13 | #endif 14 | 15 | ////////////////////////////////////////////////////////////////////////// 16 | // Array operations 17 | 18 | // searches or appends value to list (count must be preset) 19 | // returns position in list, or 20 | // -1 if maxcnt is reached prior append 21 | LUX_API int lxArrayFindOrAdd8(uint8 *list, int *inoutCnt, uint8 value, int maxCnt); 22 | LUX_API int lxArrayFindOrAdd16(uint16 *list, int *inoutCnt, uint16 value, int maxCnt); 23 | LUX_API int lxArrayFindOrAdd32(uint32 *list, int *inoutCnt, uint32 value, int maxCnt); 24 | LUX_API int lxArrayFindOrAddFloat(float *list, int *inoutCnt, float value, int maxCnt); 25 | LUX_API int lxArrayFindOrAddPtr(void **list, int *inoutCnt, void *value, int maxCnt); 26 | 27 | #ifdef __cplusplus 28 | }; 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxcore/containers.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #ifndef __LUXCORE_CONTAINERS_H__ 6 | #define __LUXCORE_CONTAINERS_H__ 7 | 8 | #include "contbitarray.h" 9 | #include "contoctree.h" 10 | #include "contscalararray.h" 11 | #include "contmap.h" 12 | #include "contstringmap.h" 13 | #include "contvector.h" 14 | #include "conthash.h" 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxcore/contmap.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #ifndef __LUXCORE_CONTMAP_H__ 6 | #define __LUXCORE_CONTMAP_H__ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C"{ 12 | #endif 13 | 14 | ////////////////////////////////////////////////////////////////////////// 15 | // ContMap 16 | // a simple map, that uses memcmp to for comparing keys 17 | // Based on vector, therefore removal can be quite costly 18 | 19 | typedef struct lxContMap_s* lxContMapPTR; 20 | typedef const struct lxContMap_s* lxContMapCPTR; 21 | 22 | typedef struct lxContMap_s{ 23 | lxContVector_t keys; 24 | lxContVector_t values; 25 | }lxContMap_t; 26 | 27 | LUX_API void lxContMap_init(lxContMapPTR cv, lxMemoryAllocatorPTR allocator, size_t keysize, size_t valsize); 28 | 29 | LUX_API booln lxContMap_set(lxContMapPTR cv, void *key, void *val); 30 | LUX_API booln lxContMap_get(lxContMapCPTR cv, void *key, void **outval); 31 | LUX_API booln lxContMap_remove(lxContMapPTR cv, void *key); 32 | 33 | // frees memory 34 | LUX_API void lxContMap_clear(lxContMapPTR cv); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxcore/contstringmap.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #ifndef __LUXCORE_STRINGMAP_HPP__ 6 | #define __LUXCORE_STRINGMAP_HPP__ 7 | 8 | #include 9 | 10 | 11 | class lxCStrDict 12 | { 13 | public: 14 | 15 | lxStrDictPTR m_ptr; 16 | 17 | LUX_INLINE operator lxStrDictPTR(){ 18 | return m_ptr; 19 | } 20 | 21 | LUX_INLINE lxStrDictKey add( const char *str ){ 22 | return lxStrDict_add(m_ptr, str); 23 | } 24 | LUX_INLINE lxStrDictName getFromKey( lxStrDictKey key ) const{ 25 | return lxStrDict_getFromKey(m_ptr, key); 26 | } 27 | LUX_INLINE lxStrDictKey getKey( const char *str ) const{ 28 | return lxStrDict_getKey(m_ptr, str); 29 | } 30 | LUX_INLINE int rem( lxStrDictName str ){ 31 | return lxStrDict_rem(m_ptr, str); 32 | } 33 | LUX_INLINE int remKey( lxStrDictKey key){ 34 | return lxStrDict_remKey(m_ptr, key); 35 | } 36 | }; 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxcore/luxcore.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #ifndef __LUXCORE_H__ 6 | #define __LUXCORE_H__ 7 | 8 | #include "scalarmisc.h" 9 | #include "containers.h" 10 | #include "memory.h" 11 | #include "arraymisc.h" 12 | #include "strmisc.h" 13 | #include "sortradix.h" 14 | #include "refsys.h" 15 | #include "handlesys.h" 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxcore/memory.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #ifndef __LUXCORE_MEMORY_H__ 6 | #define __LUXCORE_MEMORY_H__ 7 | 8 | #include "memorybase.h" 9 | #include "memorygeneric.h" 10 | #include "memorypool.h" 11 | #include "memorystack.h" 12 | #include "memorylist.h" 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxcore/memorygeneric.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #ifndef __LUXCORE_MEMORYGEN_H__ 6 | #define __LUXCORE_MEMORYGEN_H__ 7 | 8 | 9 | #include "memorybase.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C"{ 13 | #endif 14 | 15 | ////////////////////////////////////////////////////////////////////////// 16 | // MemoryGeneric, wrapper of an 17 | // generic allocator, mostly for profiling/ debugging/ stat tracking 18 | // zalloc = set to 0 19 | 20 | typedef struct lxMemoryGenericInfo_s{ 21 | ptrdiff_t allocs; 22 | ptrdiff_t mem; 23 | }lxMemoryGenericInfo_t; 24 | 25 | typedef struct lxMemoryGenericDescr_s{ 26 | void* sys; 27 | void* (__cdecl *_malloc)(void* sys, size_t sz); 28 | void* (__cdecl *_calloc)(void* sys, size_t sz, size_t num); 29 | void* (__cdecl *_realloc)(void* sys, void* ptr, size_t sz); 30 | void (__cdecl *_free)(void* sys, void* ptr); 31 | }lxMemoryGenericDescr_t; 32 | 33 | typedef struct lxMemoryGeneric_s* lxMemoryGenericPTR; 34 | 35 | LUX_API lxMemoryGenericDescr_t lxMemoryGenericDescr_default(); 36 | LUX_API lxMemoryGenericPTR lxMemoryGeneric_new(lxMemoryGenericDescr_t descr); 37 | LUX_API void lxMemoryGeneric_delete(lxMemoryGenericPTR gen); 38 | 39 | LUX_API lxMemoryGenericInfo_t lxMemoryGeneric_getInfo(lxMemoryGenericPTR gen); 40 | // returns FALSE on error 41 | LUX_API booln lxMemoryGeneric_deinitStats(lxMemoryGenericPTR gen); 42 | LUX_API void lxMemoryGeneric_dumpStats(lxMemoryGenericPTR gen, const char* fname); 43 | LUX_API lxMemoryAllocatorPTR lxMemoryGeneric_allocator(lxMemoryGenericPTR gen); 44 | 45 | ////////////////////////////////////////////////////////////////////////// 46 | 47 | LUX_INLINE lxMemoryAllocatorPTR lxMemoryGeneric_allocator(lxMemoryGenericPTR gen) 48 | { 49 | return (lxMemoryAllocatorPTR)gen; 50 | } 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | 58 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxcore/memorypool.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #ifndef __LUXCORE_MEMORYPOOL_H__ 6 | #define __LUXCORE_MEMORYPOOL_H__ 7 | 8 | #include "memorybase.h" 9 | 10 | #ifdef __cplusplus 11 | extern "C"{ 12 | #endif 13 | 14 | ////////////////////////////////////////////////////////////////////////// 15 | // MemoryPool 16 | /** 17 | * Allows to allocate a page of data which is parted 18 | * into equal sized items. You can alloc only one item per time. Usefull for data 19 | * structures with constant size like listnodes. There is no guarantee that 20 | * two allocated variables will be adjacent in the memory. 21 | * itemsize must be >= sizeof(void*). 22 | * Additional pages may be allocated depending on setting. 23 | */ 24 | 25 | typedef struct lxMemoryPool_s* lxMemoryPoolPTR; 26 | typedef const struct lxMemoryPool_s* lxMemoryPoolCPTR; 27 | 28 | // actual pageValues is at least 1 less, due to pool management costs 29 | LUX_API lxMemoryPoolPTR lxMemoryPool_new (lxMemoryAllocatorPTR allocator, uint varSize, uint pageValues, uint alignSize, booln allowMultiPages); 30 | LUX_API void lxMemoryPool_delete (lxMemoryPoolPTR mem); 31 | 32 | LUX_API void* lxMemoryPool_allocItem (lxMemoryPoolPTR mem); 33 | LUX_API void lxMemoryPool_freeItem (lxMemoryPoolPTR mem, void *ptr); 34 | LUX_API uint lxMemoryPool_shrink(lxMemoryPoolPTR mem); 35 | 36 | LUX_API uint lxMemoryPool_memUsed(lxMemoryPoolPTR mem); 37 | LUX_API uint lxMemoryPool_memAllocated(lxMemoryPoolPTR mem); 38 | LUX_API float lxMemoryPool_memRatio(lxMemoryPoolPTR mem); 39 | 40 | LUX_API uint lxMemoryPool_varSize(lxMemoryPoolCPTR mem); 41 | LUX_API uint lxMemoryPool_alignSize(lxMemoryPoolCPTR mem); 42 | 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxcore/memorypool.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #ifndef __LUXCORE_MEMORYPOOL_HPP__ 6 | #define __LUXCORE_MEMORYPOOL_HPP__ 7 | 8 | #include 9 | 10 | class lxCMemoryPool 11 | { 12 | public: 13 | lxMemoryPoolPTR m_ptr; 14 | 15 | LUX_INLINE operator lxMemoryPoolPTR(){ 16 | return m_ptr; 17 | } 18 | 19 | template 20 | LUX_INLINE T* alloc(){ 21 | LUX_ASSERT((uint)sizeof(T) == lxMemoryPool_varSize(m_ptr)); 22 | return (T*)lxMemoryPool_allocItem(m_ptr); 23 | } 24 | 25 | template 26 | LUX_INLINE void free(T* item){ 27 | LUX_ASSERT((uint)sizeof(T) == lxMemoryPool_varSize(m_ptr)); 28 | lxMemoryPool_freeItem(m_ptr, item); 29 | } 30 | 31 | LUX_INLINE void shrink(){ 32 | lxMemoryPool_shrink(m_ptr); 33 | } 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxcore/memorytlsf.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDED_tlsf 2 | #define INCLUDED_tlsf 3 | 4 | /* 5 | ** Two Level Segregated Fit memory allocator, version 1.9. 6 | ** Written by Matthew Conte, and placed in the Public Domain. 7 | ** http://tlsf.baisoku.org 8 | ** 9 | ** Based on the original documentation by Miguel Masmano: 10 | ** http://rtportal.upv.es/rtmalloc/allocators/tlsf/index.shtml 11 | ** 12 | ** Please see the accompanying Readme.txt for implementation 13 | ** notes and caveats. 14 | ** 15 | ** This implementation was written to the specification 16 | ** of the document, therefore no GPL restrictions apply. 17 | */ 18 | 19 | #include 20 | 21 | #if defined(__cplusplus) 22 | extern "C" { 23 | #endif 24 | 25 | /* Create/destroy a memory pool. */ 26 | typedef void* tlsf_pool; 27 | tlsf_pool tlsf_create(void* mem, size_t bytes); 28 | void tlsf_destroy(tlsf_pool pool); 29 | 30 | /* malloc/memalign/realloc/free replacements. */ 31 | void* tlsf_malloc(tlsf_pool pool, size_t bytes); 32 | void* tlsf_memalign(tlsf_pool pool, size_t align, size_t bytes); 33 | void* tlsf_realloc(tlsf_pool pool, void* ptr, size_t size); 34 | void tlsf_free(tlsf_pool pool, void* ptr); 35 | 36 | /* Debugging. */ 37 | typedef void (*tlsf_walker)(void* ptr, size_t size, int used, void* user); 38 | void tlsf_walk_heap(tlsf_pool pool, tlsf_walker walker, void* user); 39 | /* Returns nonzero if heap check fails. */ 40 | int tlsf_check_heap(tlsf_pool pool); 41 | 42 | /* Returns internal block size, not original request size */ 43 | size_t tlsf_block_size(void* ptr); 44 | 45 | /* Overhead of per-pool internal structures. */ 46 | size_t tlsf_overhead(); 47 | 48 | #if defined(__cplusplus) 49 | }; 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxcore/refsys.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #ifndef __LUXCORE_REFSYS_HPP__ 6 | #define __LUXCORE_REFSYS_HPP__ 7 | 8 | #include 9 | 10 | 11 | template 12 | class lxCObjRef 13 | { 14 | public: 15 | lxObjRefPTR m_refptr; 16 | 17 | lxCObjRef() : m_refptr(NULL) {} 18 | lxCObjRef(lxObjRefPTR ptr) : m_refptr(ptr) {} 19 | 20 | LUX_INLINE operator lxObjRefPTR&(){ 21 | return m_refptr; 22 | } 23 | 24 | LUX_INLINE T* getPtr(){ 25 | return lxObjRef_getPtr(m_refptr); 26 | } 27 | 28 | LUX_INLINE booln getSafe(T** out){ 29 | return lxObjRef_getSafe(m_refptr, out); 30 | } 31 | 32 | LUX_INLINE operator bool(){ 33 | return m_refptr != NULL; 34 | } 35 | 36 | LUX_INLINE operator T*(){ 37 | #ifdef _DEBUG 38 | T* ptr; 39 | booln res = getSafe(&ptr); 40 | LUX_ASSERT(res); 41 | return ptr; 42 | #else 43 | return getPtr(); 44 | #endif 45 | } 46 | 47 | LUX_INLINE void addWeak(){ 48 | return lxObjRef_addWeak(m_refptr); 49 | } 50 | 51 | LUX_INLINE booln addUser(){ 52 | return lxObjRef_addWeak(m_refptr); 53 | } 54 | 55 | LUX_INLINE void releaseWeak(){ 56 | return lxObjRef_releaseWeak(m_refptr); 57 | } 58 | 59 | LUX_INLINE booln releaseUser(){ 60 | return lxObjRef_releaseUser(m_refptr); 61 | } 62 | }; 63 | 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxcore/sortradix.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | // 5 | // Forwards to code by Pierre Terdiman 6 | 7 | 8 | #ifndef __LUXCORE_SORTRADIX_H__ 9 | #define __LUXCORE_SORTRADIX_H__ 10 | 11 | #include 12 | 13 | #ifdef __cplusplus 14 | extern "C"{ 15 | #endif 16 | 17 | // returns pointer to indices1 or indices2 18 | // which must have "size" length 19 | // indices1 must be preinitialized with used indices 20 | // NOT THREADSAFE!! 21 | LUX_API uint32* lxSortRadixArrayInt(const uint32 *data, uint size, booln sign, uint32 *indices1, uint32 *indices2); 22 | LUX_API uint32* lxSortRadixArrayFloat(const float *data, uint size, uint32 *indices1, uint32 *indices2); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxmath/float16.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | // Based on Nvidia SDK 6 | 7 | #ifndef __LUXMATH_FLOAT16_H__ 8 | #define __LUXMATH_FLOAT16_H__ 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C"{ 14 | #endif 15 | 16 | LUX_API float16 lxFloat32To16( float fval ); 17 | LUX_API float lxFloat16To32( float16 ival ); 18 | 19 | ////////////////////////////////////////////////////////////////////////// 20 | 21 | LUX_INLINE float16 lxFloat32To16( float fval ) 22 | { 23 | unsigned long ival= * (unsigned long*)( &fval ); 24 | if( !ival ){ 25 | return 0; 26 | } 27 | else{ 28 | int e=((ival & 0x7f800000)>>23) - 127 + 15; 29 | if( e < 0 ){ 30 | return 0; 31 | }else if( e > 31 ){ 32 | e= 31; 33 | } 34 | { 35 | unsigned long s= ival & 0x80000000; 36 | unsigned long f= ival & 0x007fffff; 37 | return (float16) (((s>>16)&0x8000) | ((e<<10) & 0x7c00) | ((f>>13) & 0x03ff)); 38 | } 39 | } 40 | } 41 | 42 | LUX_INLINE float lxFloat16To32( float16 ival ) 43 | { 44 | if( !ival ){ 45 | return 0.0f; 46 | } 47 | else 48 | { 49 | unsigned long s= ival & 0x8000; 50 | signed long e=((ival & 0x7c00) >>10) - 15 + 127; 51 | unsigned long f= ival & 0x03ff; 52 | unsigned long fval= (s<<16) | ((e <<23)&0x7f800000) | (f<<13); 53 | return * (float*)( &fval ); 54 | } 55 | } 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif 62 | 63 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxmath/geometry.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | 6 | 7 | #ifndef __LUXMATH_GEOMETRY_H__ 8 | #define __LUXMATH_GEOMETRY_H__ 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C"{ 14 | #endif 15 | 16 | LUX_API void lxPlaneSet(lxPlanePTR plane, const lxVector3 a, const lxVector3 b, const lxVector3 c); 17 | 18 | LUX_API void lxPlaneIntersect(lxVector3 out, lxPlaneCPTR planea,lxPlaneCPTR planeb,lxPlaneCPTR planec); 19 | 20 | LUX_API void lxPlaneVecCheckLine(lxVector3 intersectpoint, const lxVector3 planenormal, 21 | const lxVector3 planepoint, const lxVector3 raystart, const lxVector3 rayend); 22 | 23 | LUX_API float lxTriangleArea( const lxVector3 v0, const lxVector3 v1, const lxVector3 v2); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxmath/luxmath.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #ifndef __LUXMATH_H__ 6 | #define __LUXMATH_H__ 7 | 8 | ////////////////////////////////////////////////////////////////////////// 9 | // LUXMATH 10 | // 11 | // Library for math in 3d space 12 | // Author: Christoph Kubisch 13 | 14 | 15 | #include 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxmath/xmmmath.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/backend/include/luxinia/luxmath/xmmmath.h -------------------------------------------------------------------------------- /backend/include/luxinia/luxplatform/debug.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | 6 | 7 | #ifndef __LUXPLATFORM_DEBUG_H__ 8 | #define __LUXPLATFORM_DEBUG_H__ 9 | 10 | #include 11 | 12 | ////////////////////////////////////////////////////////////////////////// 13 | // Debug 14 | 15 | #ifdef __cplusplus 16 | extern "C"{ 17 | #endif 18 | 19 | LUX_API void lxDebugAssertFailed( const char *file, int line, const char *expression ); 20 | LUX_API void lxDebugPrintf(const char* format, ...); 21 | 22 | 23 | ////////////////////////////////////////////////////////////////////////// 24 | #ifdef LUX_DEVBUILD 25 | #define LUX_ASSERT( X ) if ( !(X) ) lxDebugAssertFailed( __FILE__, __LINE__, #X ) 26 | #define LUX_PRINTF lxDebugPrintf 27 | #else 28 | #define LUX_ASSERT LUX_NOOP 29 | #define LUX_PRINTF LUX_NOOP 30 | #endif 31 | 32 | #ifdef _DEBUG 33 | #define LUX_DEBUGASSERT( X ) if ( !(X) ) lxDebugAssertFailed( __FILE__, __LINE__, #X ) 34 | #define LUX_DEBUGPRINTF lxDebugPrintf 35 | #ifdef LUX_SIMD 36 | #define LUX_SIMDASSERT( X ) if ( !(X) ) lxDebugAssertFailed( __FILE__, __LINE__, #X ) 37 | #else 38 | #define LUX_SIMDASSERT LUX_NOOP 39 | #endif 40 | #else 41 | #define LUX_DEBUGASSERT LUX_NOOP 42 | #define LUX_DEBUGPRINTF LUX_NOOP 43 | #define LUX_SIMDASSERT LUX_NOOP 44 | #endif 45 | 46 | #ifdef __cplusplus 47 | }; 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxplatform/endian.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | 6 | 7 | #ifndef __LUXPLATFORM_ENDIAN_H__ 8 | #define __LUXPLATFORM_ENDIAN_H__ 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C"{ 14 | #endif 15 | 16 | ////////////////////////////////////////////////////////////////////////// 17 | // Endianess 18 | 19 | 20 | LUX_API booln lxEndian_isBig(); 21 | 22 | LUX_API short lxEndian_shortBig(short val); 23 | LUX_API short lxEndian_shortLittle(short val); 24 | LUX_API long lxEndian_longBig(long val); 25 | LUX_API long lxEndian_longLittle(long val); 26 | LUX_API float lxEndian_floatBig(float val); 27 | LUX_API float lxEndian_floatLittle(float val); 28 | 29 | #ifdef __cplusplus 30 | }; 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxplatform/file.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | 6 | 7 | #ifndef __LUXCORE_FILE_H__ 8 | #define __LUXCORE_FILE_H__ 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C"{ 14 | #endif 15 | 16 | typedef struct lxFSFile_s 17 | { 18 | byte *contents; 19 | size_t index; 20 | size_t size; 21 | 22 | booln freecontent; 23 | }lxFSFile_t; 24 | 25 | LUX_API booln lxFS_setCurrent(lxFSFile_t *file, void *data); 26 | LUX_API void* lxFS_getCurrent(lxFSFile_t *file); 27 | LUX_API void* lxFS_getContent(lxFSFile_t *file); 28 | LUX_API size_t lxFS_getSize(lxFSFile_t *file); 29 | 30 | 31 | LUX_API char* lxFS_gets(char *buffer, size_t size, lxFSFile_t *file); 32 | LUX_API char lxFS_eof(lxFSFile_t *file); 33 | LUX_API char lxFS_getc(lxFSFile_t *file); 34 | LUX_API size_t lxFS_read(void* target, size_t size, size_t count,lxFSFile_t *file); 35 | LUX_API size_t lxFS_seek(lxFSFile_t* file, size_t offset, size_t origin); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxplatform/luxconfig.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | ////////////////////////////////////////////////////////////////////////// 6 | // General Defines 7 | // 8 | // LUX_DEVBUILD 9 | // is always set on _DEBUG, but can be part of a release build as well 10 | // certain features might only be performed in _DEBUG 11 | // Main purpose is to have additional checking and info in release 12 | // builds. 13 | // 14 | // LUX_SIMD 15 | // if SIMD functionality can be assumed as minimum 16 | // depending on compiler & architecture LUX_SIMD_SSE is set 17 | // to allow xmmintrin.h functionality 18 | // 19 | // LUX_RENDERBACKEND 20 | // one of the following must be specified 21 | // _OPENGL1 (assumes "compatibility" profile) 22 | // _OPENGL3 (not yet implemented) 23 | // 24 | // LUX_COMPILERINTRINSICS 25 | // allows LUX_ASSUME,LUX_RESTRICT,LUX_FASTCALL 26 | // 27 | // LUX_API_EXPORTS, LUX_API_IMPORTS 28 | // for dll & lib generation 29 | 30 | #ifndef LUX_RENDERBACKEND_OPENGL1 31 | #define LUX_RENDERBACKEND_OPENGL1 32 | #endif 33 | 34 | #ifndef LUX_SIMD 35 | #define LUX_SIMD 36 | #endif 37 | 38 | #ifndef LUX_COMPILERINTRINSICS 39 | #define LUX_COMPILERINTRINSICS 40 | #endif 41 | 42 | #ifndef LUX_API_IMPORTS 43 | #define LUX_API_EXPORTS 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxscene/luxscene.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #ifndef __LUXSCENE_H__ 6 | #define __LUXSCENE_H__ 7 | 8 | #include 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxscene/mesh.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #ifndef __LUXSCENE_MESH_H__ 6 | #define __LUXSCENE_MESH_H__ 7 | 8 | #include "meshbase.h" 9 | #include "meshvcacheopt.h" 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /backend/include/luxinia/luxscene/meshvcacheopt.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/backend/include/luxinia/luxscene/meshvcacheopt.h -------------------------------------------------------------------------------- /backend/luxcore/cont_defs.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #ifndef __LUXCORE_CONTDEFS_H__ 6 | #define __LUXCORE_CONTDEFS_H__ 7 | 8 | #include 9 | #include "memory_defs.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C"{ 13 | #endif 14 | 15 | 16 | ////////////////////////////////////////////////////////////////////////// 17 | #define CONT_HASH_PAGEBYTES 512 18 | 19 | typedef struct lxContHashEntry_s{ 20 | uint32 key; 21 | struct lxContHashEntry_s* next; 22 | union{ 23 | void* data; 24 | byte bytes[sizeof(void*)]; 25 | }; 26 | 27 | }lxContHashEntry_t; 28 | 29 | typedef struct lxContHash_s{ 30 | uint32 mask; 31 | uint numBins; 32 | uint valueSize; 33 | lxMemoryPool_t mempool; 34 | lxContHashEntry_t* table[1]; 35 | }lxContHash_t; 36 | 37 | void lxContHash_init(lxContHash_t *cv, lxMemoryAllocatorPTR allocator, uint numBins, uint valueSize); 38 | void lxContHash_deinit(lxContHash_t *cv); 39 | size_t lxContHash_sizeof(uint numBins); 40 | 41 | 42 | ////////////////////////////////////////////////////////////////////////// 43 | 44 | typedef struct lxContPtrHashEntry_s{ 45 | void* key; 46 | struct lxContPtrHashEntry_s* next; 47 | union{ 48 | void* data; 49 | byte bytes[sizeof(void*)]; 50 | }; 51 | 52 | }lxContPtrHashEntry_t; 53 | 54 | typedef struct lxContPtrHash_s{ 55 | uint32 mask; 56 | uint numBins; 57 | uint valueSize; 58 | lxMemoryPool_t mempool; 59 | lxContPtrHashEntry_t* table[1]; 60 | }lxContPtrHash_t; 61 | 62 | void lxContPtrHash_init(lxContPtrHash_t *cv, lxMemoryAllocatorPTR allocator, uint numBins, uint valueSize); 63 | void lxContPtrHash_deinit(lxContPtrHash_t *cv); 64 | size_t lxContPtrHash_sizeof(uint numBins); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /backend/luxcore/contbitarray.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/backend/luxcore/contbitarray.c -------------------------------------------------------------------------------- /backend/luxcore/contmap.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #include 6 | 7 | LUX_API void lxContMap_init(lxContMapPTR cv, lxMemoryAllocatorPTR allocator, size_t keysize, size_t valsize) 8 | { 9 | lxContVector_init(&cv->keys,allocator,keysize); 10 | lxContVector_init(&cv->values,allocator,valsize); 11 | } 12 | 13 | LUX_API booln lxContMap_set(lxContMapPTR cv, void *key, void *val) 14 | { 15 | if (lxContVector_find(&cv->keys,key) != -1) return LUX_FALSE; 16 | 17 | lxContVector_pushBack(&cv->keys,key); 18 | lxContVector_pushBack(&cv->values,val); 19 | 20 | return LUX_TRUE; 21 | } 22 | LUX_API booln lxContMap_remove(lxContMapPTR cv, void *key) 23 | { 24 | int idx = lxContVector_find(&cv->keys,key) ; 25 | if (idx != -1) return LUX_FALSE; 26 | 27 | lxContVector_removeUnsorted(&cv->keys,idx); 28 | lxContVector_removeUnsorted(&cv->values,idx); 29 | 30 | return LUX_TRUE; 31 | } 32 | LUX_API booln lxContMap_get(lxContMapCPTR cv, void *key, void**outval) 33 | { 34 | int idx = lxContVector_find(&cv->keys,key); 35 | if (idx == -1) return LUX_FALSE; 36 | 37 | *outval = lxContVector_at((lxContVectorPTR)&cv->values,idx); 38 | return LUX_TRUE; 39 | } 40 | 41 | LUX_API void lxContMap_clear(lxContMapPTR cv) 42 | { 43 | lxContVector_clear(&cv->keys); 44 | lxContVector_clear(&cv->values); 45 | } 46 | -------------------------------------------------------------------------------- /backend/luxcore/handlesys.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #include 6 | #include 7 | 8 | LUX_API void lxHandleSys_init( lxHandleSysPTR sys ) 9 | { 10 | int i; 11 | sys->numUsed = 0; 12 | sys->firstUnused = 0; 13 | for ( i = 0; i < LUX_HANDLESYS_MAX; i++){ 14 | lxHandleEntry_t* entry = &sys->entries[i]; 15 | entry->nextUnused = i+1; 16 | entry->handle.type |= (~0); 17 | entry->handle.counter = 0; 18 | entry->handle.idx = i; 19 | } 20 | } 21 | 22 | LUX_API lxHandleID lxHandleSys_add( lxHandleSysPTR sys, uint32 type, void *data ) 23 | { 24 | lxHandleEntry_t* entry = &sys->entries[sys->firstUnused]; 25 | LUX_ASSERT(type >= 1); 26 | LUX_ASSERT(sys->numUsed < LUX_HANDLESYS_MAX); 27 | entry->handle.counter++; 28 | entry->handle.type = type; 29 | sys->firstUnused = entry->nextUnused; 30 | entry->data = data; 31 | sys->numUsed++; 32 | 33 | return *((lxHandleID*)&entry->handle); 34 | } 35 | 36 | LUX_API booln lxHandleSys_rem( lxHandleSysPTR sys, lxHandleID id ) 37 | { 38 | int idx = lxHandleSys_checkIdx(sys,id); 39 | lxHandleEntry_t* entry = &sys->entries[idx]; 40 | if (idx < 0) return LUX_FALSE; 41 | 42 | entry->handle.type |= (~0); 43 | entry->nextUnused = sys->firstUnused; 44 | sys->firstUnused = idx; 45 | 46 | return LUX_TRUE; 47 | } 48 | 49 | LUX_API booln lxHandleSys_replace( lxHandleSysPTR sys, lxHandleID id, void *data ) 50 | { 51 | int idx = lxHandleSys_checkIdx(sys,id); 52 | lxHandleEntry_t* entry = &sys->entries[idx]; 53 | if (idx < 0) return LUX_FALSE; 54 | 55 | entry->data = data; 56 | return LUX_TRUE; 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /backend/luxcore/memorybase.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #include 6 | 7 | 8 | 9 | ////////////////////////////////////////////////////////////////////////// 10 | // Aligned alloc/free 11 | #if 0 12 | void* lxMemAlignedAlloc(size_t size, size_t align_size) 13 | { 14 | 15 | char *ptr=(char *)MEMORY_GLOBAL_MALLOC(size + align_size + sizeof(size_t)); 16 | if(ptr==NULL) return(NULL); 17 | 18 | return(lxMemAlignedFromOrig(ptr,align_size)); 19 | } 20 | 21 | void lxMemAlignedFree(void *ptr) 22 | { 23 | MEMORY_GLOBAL_FREE(lxMemAlignedToOrig(ptr)); 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /backend/luxmath/fastmath.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #include 6 | #include 7 | 8 | lxFastMathCache_t* lx_gFastMath; 9 | 10 | ////////////////////////////////////////////////////////////////////////// 11 | // build up tables 12 | typedef union FastSqrtUnion 13 | { 14 | float f; 15 | unsigned int i; 16 | } FastSqrtUnion; 17 | 18 | LUX_API void lxFastMath_initset(lxFastMathCache_t* cache) 19 | { 20 | lx_gFastMath = cache; 21 | } 22 | 23 | LUX_API void lxFastMath_init(lxFastMathCache_t* cache) 24 | { 25 | 26 | unsigned int i; 27 | FastSqrtUnion s; 28 | 29 | lx_gFastMath = cache; 30 | 31 | for (i = 0; i <= 0x7FFF; i++) 32 | { 33 | 34 | // Build a float with the bit pattern i as mantissa 35 | // and an exponent of 0, stored as 127 36 | 37 | s.i = (i << 8) | (0x7F << 23); 38 | s.f = (float)sqrt(s.f); 39 | 40 | // Take the square root then strip the first 7 bits of 41 | // the mantissa into the table 42 | 43 | cache->fast_sqrt_table[i + 0x8000] = (s.i & 0x7FFFFF); 44 | 45 | // Repeat the process, this time with an exponent of 1, 46 | // stored as 128 47 | 48 | s.i = (i << 8) | (0x80 << 23); 49 | s.f = (float)sqrt(s.f); 50 | 51 | cache->fast_sqrt_table[i] = (s.i & 0x7FFFFF); 52 | } 53 | 54 | for (i = 0; i < LUX_MATH_MAX_CIRCLE_ANGLE; i++){ 55 | cache->mathcossintable[i] = (float)sin((double)i * LUX_MUL_PI / MATH_HALF_MAX_CIRCLE_ANGLE); 56 | } 57 | } -------------------------------------------------------------------------------- /backend/luxmath/geometry.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | LUX_API void lxPlaneSet 11 | (lxPlanePTR plane, const lxVector3 a, const lxVector3 b, const lxVector3 c) 12 | { 13 | lxVector3 toB; 14 | lxVector3 toC; 15 | 16 | lxVector3Sub(toB,b,a); 17 | lxVector3Sub(toC,c,a); 18 | lxVector3Cross(plane,toB,toC); 19 | lxVector3Normalized(plane); 20 | plane[3] = -lxVector3Dot(plane,a); 21 | } 22 | 23 | LUX_API void lxPlaneIntersect 24 | (lxVector3 out, lxPlaneCPTR planea,lxPlaneCPTR planeb,lxPlaneCPTR planec) 25 | { 26 | // http://local.wasp.uwa.edu.au/~pbourke/geometry/3planes/ 27 | lxVector3 da; 28 | lxVector3 db; 29 | lxVector3 dc; 30 | 31 | lxVector3Cross(da,planec,planeb); 32 | lxVector3Cross(db,planea,planec); 33 | lxVector3Cross(dc,planeb,planea); 34 | 35 | lxVector3Scale(dc,dc,-planec[3]); 36 | lxVector3ScaledAdd(dc,dc,-planeb[3],db); 37 | lxVector3ScaledAdd(dc,dc,-planea[3],da); 38 | 39 | lxVector3Scale(out,dc,1.0f/(lxVector3Dot(planea,da))); 40 | } 41 | 42 | LUX_API void lxPlaneVecCheckLine 43 | (lxVector3 intersectpoint, const lxVector3 planenormal, const lxVector3 planepoint, const lxVector3 raystart, const lxVector3 rayend) 44 | { 45 | lxVector3 dir; 46 | float ratio; 47 | float distp = lxVector3Dot(planenormal,planepoint); 48 | float diststart = lxVector3Dot(planenormal,raystart); 49 | float distend = lxVector3Dot(planenormal,rayend); 50 | 51 | ratio = (distp-diststart)/(distend-diststart); 52 | ratio = LUX_MIN(ratio,1.0f); 53 | ratio = LUX_MAX(ratio,0.0f); 54 | lxVector3Sub(dir,rayend,raystart); 55 | lxVector3ScaledAdd(intersectpoint,raystart,ratio,dir); 56 | } 57 | 58 | LUX_API float lxTriangleArea 59 | ( const lxVector3 v0, const lxVector3 v1, const lxVector3 v2) 60 | { 61 | lxVector3 a,b,cross; 62 | lxVector3Sub(a,v1,v0); 63 | lxVector3Sub(b,v2,v0); 64 | lxVector3Cross(cross,a,b); 65 | 66 | return lxVector3LengthFast(cross)*0.5f; 67 | } 68 | -------------------------------------------------------------------------------- /backend/luxmath/matrix34.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #include 6 | 7 | const LUX_ALIGNSIMD_V(float lx_gMatrix34_ident[12]) = 8 | { 9 | 1.0f, 0.0f, 0.0f, 0.0f, 10 | 0.0f, 1.0f, 0.0f, 0.0f, 11 | 0.0f, 0.0f, 1.0f, 0.0f, 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /backend/luxmath/misc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/backend/luxmath/misc.c -------------------------------------------------------------------------------- /backend/luxmath/vector2.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #include -------------------------------------------------------------------------------- /backend/luxmath/vector3.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/backend/luxmath/vector3.c -------------------------------------------------------------------------------- /backend/luxmath/vector4.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #include -------------------------------------------------------------------------------- /backend/luxmath/xmmmath.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch 2 | // This file is part of the "Luxinia Engine". 3 | // See copyright notice in luxplatform.h 4 | 5 | #include 6 | 7 | #ifdef LUX_SIMD_SSE 8 | 9 | 10 | static void SSE_compile_test() 11 | { 12 | lxVector4SSE veca = lxVector4SSE_setAll(2.0f); 13 | lxVector4SSE vecb = lxVector4SSE_setAll(2.0f); 14 | lxVector4SSE vecc = lxVector4SSE_setAll(2.0f); 15 | lxVector4SSE vecd = lxVector4SSE_setAll(2.0f); 16 | veca = lxVector4SSE_vcatmullRom(lxVector4SSE_setAll(1.0),&veca,&vecb,&vecc,&vecd); 17 | } 18 | 19 | 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /backend/luxscene/meshvcacheoptforsyth.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/backend/luxscene/meshvcacheoptforsyth.cpp -------------------------------------------------------------------------------- /backend/luxscene/meshvcacheopttipsify.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/backend/luxscene/meshvcacheopttipsify.cpp -------------------------------------------------------------------------------- /engine/base/gpuprogs/bump_posinv_lit1.vp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | 3 | # NORMAL Shader 4 | # posinv ! 5 | # 0 light, 2 textures 6 | # 7 | # computes tangent space light direction vector 8 | # output color is lights1-3+ambient0 9 | 10 | # sunlight: point light, no attenuation light[0] 11 | # fxlights: point light, attenuation light[1-3] 12 | # fogcoord: distance to eyeplane 13 | # tex0: texmatrix 14 | # tex1: cubemap coords for tangent space light vector 15 | # 16 | # by Christoph Kubisch 17 | 18 | # cause we use multi pass 19 | OPTION ARB_position_invariant; 20 | 21 | # Incoming vertex attributes: 22 | ATTRIB inColor = vertex.color; 23 | ATTRIB inPos = vertex.position; 24 | ATTRIB inNormal = vertex.normal; 25 | ATTRIB inTex0 = vertex.texcoord[0]; 26 | ATTRIB inTangent = vertex.attrib[14]; # tangent 27 | 28 | # Outgoing vertex attributes: 29 | OUTPUT outColor = result.color; 30 | OUTPUT outTex0 = result.texcoord[0]; # normal map coords 31 | OUTPUT outTex1 = result.texcoord[1]; # cubemap coords 32 | 33 | # Parameters: 34 | PARAM lightpos = program.local[0] ; 35 | PARAM lightcolor = state.light[0].diffuse ; 36 | PARAM lightambi = state.light[0].ambient ; 37 | PARAM mtex0[] = { state.matrix.texture[0].row[0..1] }; 38 | 39 | 40 | TEMP pos; # Temporary pos/scalar 41 | TEMP ldir; # Light Direction texture space 42 | TEMP binormal; # Binormal 43 | 44 | 45 | # Compute light direction 46 | # pos = light vector 47 | SUB pos, lightpos, inPos; 48 | 49 | # Compute Binormal 50 | XPD binormal, inNormal,inTangent; 51 | MUL binormal, binormal, -inTangent.w; 52 | 53 | # Rotate light direction to TextureSpace 54 | # ldir = light vector (TS) 55 | DP3 ldir.x, pos, inTangent; 56 | DP3 ldir.y, pos, binormal; 57 | DP3 ldir.z, pos, inNormal; 58 | # if on backside then ldir.z is negative 59 | # in that case clear xy directions to make sure 60 | # dotprod will always be 0 61 | SLT ldir.w, ldir.z, 0.0; 62 | MUL ldir.w, ldir.w, 5.0; 63 | MAD ldir.z, ldir.w, ldir.z,ldir.z; 64 | MOV outTex1, ldir; 65 | 66 | 67 | # Output Texcoords 68 | DP4 outTex0.x, mtex0[0], inTex0; 69 | DP4 outTex0.y, mtex0[1], inTex0; 70 | 71 | # Output Color 72 | MOV outColor, lightambi; 73 | 74 | END 75 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/bump_posinv_unlit.vp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | 3 | # NORMAL Shader 4 | # posinv ! 5 | # 0 light, 2 textures 6 | # 7 | # computes tangent space light direction vector 8 | # output color is lights1-3+ambient0 9 | 10 | # sunlight: point light, no attenuation light[0] 11 | # fxlights: point light, attenuation light[1-3] 12 | # fogcoord: distance to eyeplane 13 | # tex0: texmatrix 14 | # tex1: cubemap coords for tangent space light vector 15 | # 16 | # by Christoph Kubisch 17 | 18 | # cause we use multi pass 19 | OPTION ARB_position_invariant; 20 | 21 | # Incoming vertex attributes: 22 | ATTRIB inColor = vertex.color; 23 | ATTRIB inPos = vertex.position; 24 | ATTRIB inNormal = vertex.normal; 25 | ATTRIB inTex0 = vertex.texcoord[0]; 26 | ATTRIB inTangent = vertex.attrib[14]; # tangent 27 | 28 | # Outgoing vertex attributes: 29 | OUTPUT outColor = result.color; 30 | OUTPUT outTex0 = result.texcoord[0]; # normal map coords 31 | OUTPUT outTex1 = result.texcoord[1]; # cubemap coords 32 | 33 | # Parameters: 34 | PARAM lightpos = {0.577,0.577,0.577,1} ; 35 | PARAM lightcolor = state.light[0].diffuse ; 36 | PARAM mtex0[] = { state.matrix.texture[0].row[0..1] }; 37 | 38 | TEMP ldir; # Light_t Direction texture space 39 | TEMP binormal; # Binormal 40 | 41 | # Compute Binormal 42 | XPD binormal, inNormal, inTangent; 43 | MUL binormal, binormal, -inTangent.w; 44 | 45 | # Rotate light direction to TextureSpace 46 | # ldir = light vector (TS) 47 | DP3 ldir.x, lightpos, inTangent; 48 | DP3 ldir.y, lightpos, binormal; 49 | DP3 ldir.z, lightpos, inNormal; 50 | # if on backside then ldir.z is negative 51 | # in that case clear xy directions to make sure 52 | # dotprod will always be 0 53 | SLT ldir.w, ldir.z, 0.0; 54 | MUL ldir.w, ldir.w, 5.0; 55 | MAD ldir.z, ldir.w, ldir.z,ldir.z; 56 | MOV outTex1, ldir; 57 | 58 | 59 | # Output Texcoords 60 | DP4 outTex0.x, mtex0[0], inTex0; 61 | DP4 outTex0.y, mtex0[1], inTex0; 62 | 63 | # Output Color 64 | MOV outColor, 0; 65 | 66 | END 67 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/particle_batch.vp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | 3 | # BILLBOARD Shader 4 | # screen aligned, fog, 2 texture 5 | # 6 | # screen aligned: mesh faces camera, scaled with vertexattrib 7 | # fogcoord: distance to eyeplane 8 | # textures: facemap, shifted along y based on vertexattrib 9 | # 10 | # by Christoph Kubisch 11 | 12 | # Incoming vertex attributes: 13 | ATTRIB inPos = vertex.position; 14 | ATTRIB inParams = vertex.texcoord[0]; # = { Index, Size, texnum, 1 } 15 | ATTRIB inColor = vertex.color; 16 | 17 | # Outgoing vertex attributes: 18 | OUTPUT outPos = result.position; 19 | OUTPUT outColor = result.color; 20 | OUTPUT outTex0 = result.texcoord[0]; 21 | OUTPUT outTex1 = result.texcoord[1]; 22 | OUTPUT outFog = result.fogcoord; 23 | 24 | # Parameters: 25 | PARAM mvp[4] = { state.matrix.projection }; 26 | PARAM offsets[64] = { program.local[1..64] }; 27 | #PARAM texoffsets[32]= { program.local[33..64] }; 28 | PARAM texwidth = program.local[0]; 29 | PARAM mtex0[] = { state.matrix.texture[0].row[0..1] }; 30 | PARAM mtex1[] = { state.matrix.texture[1].row[0..1] }; 31 | 32 | TEMP pos,temp; # Temporary position. 33 | ADDRESS arOffset; # Address register used to read offsets. 34 | 35 | 36 | # Fetch the offset vector for the current vertex. 37 | ARL arOffset.x, inParams.x; 38 | 39 | # Scale the offset by the particle's size and add it to the particle position. 40 | MAD pos, offsets[arOffset.x], inParams.yyyw, inPos; 41 | MOV pos.w, inPos.w; 42 | 43 | # Transform the vertex to clip space. 44 | DP4 temp.x, mvp[0], pos; 45 | DP4 temp.y, mvp[1], pos; 46 | DP4 temp.z, mvp[2], pos; 47 | DP4 temp.w, mvp[3], pos; 48 | MOV outPos, temp; 49 | 50 | # Output fog 51 | ABS outFog.x, temp.z; 52 | 53 | # compute outtex 54 | MOV pos, offsets[arOffset.x+32]; 55 | ADD pos.x, inParams.zzzw, pos.xxxw; 56 | MUL pos, pos, texwidth; 57 | 58 | # Output Tex 59 | DP4 outTex1.x, mtex1[0], pos; 60 | DP4 outTex1.y, mtex1[1], pos; 61 | 62 | DP4 outTex0.x, mtex0[0], pos; 63 | DP4 outTex0.y, mtex0[1], pos; 64 | 65 | # Output color. 66 | MOV outColor, inColor; 67 | 68 | END 69 | 70 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/particle_batch_lm.vp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | 3 | # BILLBOARD Shader 4 | # screen aligned, fog, 2 texture 5 | # 6 | # screen aligned: mesh faces camera, scaled with vertexattrib 7 | # fogcoord: distance to eyeplane 8 | # textures: facemap, shifted along y based on vertexattrib 9 | # 10 | # by Christoph Kubisch 11 | 12 | # Incoming vertex attributes: 13 | ATTRIB inPos = vertex.position; 14 | ATTRIB inParams = vertex.texcoord[0]; # = { Index, Size, texnum, 1 } 15 | ATTRIB inColor = vertex.color; 16 | 17 | # Outgoing vertex attributes: 18 | OUTPUT outPos = result.position; 19 | OUTPUT outColor = result.color; 20 | OUTPUT outTex0 = result.texcoord[0]; 21 | OUTPUT outTex1 = result.texcoord[1]; 22 | OUTPUT outFog = result.fogcoord; 23 | 24 | # Parameters: 25 | PARAM mvp[4] = { state.matrix.projection }; 26 | PARAM offsets[64] = { program.local[1..64] }; 27 | #PARAM texoffsets[32]= { program.local[33..64] }; 28 | PARAM texwidth = program.local[0]; 29 | PARAM mtex0[] = { state.matrix.texture[0].row[0..1] }; 30 | PARAM mtex1[] = { state.matrix.texture[1].row[0..1] }; 31 | PARAM mtexgenS = state.texgen[1].eye.s ; 32 | PARAM mtexgenT = state.texgen[1].eye.t ; 33 | 34 | TEMP pos,temp; # Temporary position. 35 | ADDRESS arOffset; # Address register used to read offsets. 36 | 37 | 38 | # Fetch the offset vector for the current vertex. 39 | ARL arOffset.x, inParams.x; 40 | 41 | # Scale the offset by the particle's size and add it to the particle position. 42 | MAD pos, offsets[arOffset.x], inParams.yyyw, inPos; 43 | MOV pos.w, inPos.w; 44 | 45 | # Transform the vertex to clip space. 46 | DP4 temp.x, mvp[0], pos; 47 | DP4 temp.y, mvp[1], pos; 48 | DP4 temp.z, mvp[2], pos; 49 | DP4 temp.w, mvp[3], pos; 50 | MOV outPos, temp; 51 | 52 | # Output fog 53 | ABS outFog.x, temp.z; 54 | 55 | # texgen for lightmap 56 | DP4 outTex1.x, mtexgenS, pos; 57 | DP4 outTex1.y, mtexgenT, pos; 58 | 59 | # compute outtex 60 | MOV pos, offsets[arOffset.x+32]; 61 | ADD pos.x, inParams.zzzw, pos.xxxw; 62 | MUL pos, pos, texwidth; 63 | 64 | DP4 outTex0.x, mtex0[0], pos; 65 | DP4 outTex0.y, mtex0[1], pos; 66 | 67 | # Output color. 68 | MOV outColor, inColor; 69 | 70 | END 71 | 72 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/particle_instance.vp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | 3 | # PARTICLE INSTANCE Shader 4 | # screen aligned rotated, fog, 2 texture 5 | # 6 | # worldtransform stored in vertex attrib 7 | # fogcoord: distance to eyeplane 8 | # textures: facemap, shifted along y based on vertexattrib 9 | # 10 | # by Christoph Kubisch 11 | 12 | # Incoming vertex attributes: 13 | ATTRIB inPos = vertex.position; 14 | ATTRIB inTex = vertex.texcoord[0]; 15 | ATTRIB inColor = vertex.attrib[13]; 16 | 17 | ATTRIB inMatrix0 = vertex.attrib[9]; 18 | ATTRIB inMatrix1 = vertex.attrib[10]; 19 | ATTRIB inMatrix2 = vertex.attrib[11]; 20 | 21 | ATTRIB inParams = vertex.attrib[12]; # = { texnum, relage , speed} 22 | 23 | # Outgoing vertex attributes: 24 | OUTPUT outPos = result.position; 25 | OUTPUT outColor = result.color; 26 | OUTPUT outTex0 = result.texcoord[0]; 27 | OUTPUT outTex1 = result.texcoord[1]; 28 | OUTPUT outFog = result.fogcoord; 29 | 30 | # Parameters: 31 | PARAM mvp[4] = { state.matrix.projection }; 32 | PARAM texwidth = program.local[0]; 33 | PARAM mtex0[2] = { state.matrix.texture[0].row[0..1] }; 34 | PARAM mtex1[2] = { state.matrix.texture[1].row[0..1] }; 35 | 36 | TEMP pos; # Temporary position. 37 | TEMP rot; # Temporary rotation 38 | 39 | 40 | 41 | # Transform to world 42 | DP4 pos.x, inPos,inMatrix0; 43 | DP4 pos.y, inPos,inMatrix1; 44 | DP4 pos.z, inPos,inMatrix2; 45 | MOV pos.w, 1.0; 46 | 47 | # Transform the vertex to clip space. 48 | DP4 rot.x, mvp[0], pos; 49 | DP4 rot.y, mvp[1], pos; 50 | DP4 rot.z, mvp[2], pos; 51 | DP4 rot.w, mvp[3], pos; 52 | MOV outPos, rot; 53 | 54 | # Output fog 55 | ABS outFog.x, rot.z; 56 | 57 | # compute outtex 58 | MOV pos,inTex; 59 | ADD pos.x, inParams.xxxw, inTex.xxxw; 60 | MUL pos, pos, texwidth; 61 | 62 | # Output Tex 63 | MOV outTex1, 1; 64 | DP4 outTex1.x, mtex1[0], pos; 65 | DP4 outTex1.y, mtex1[1], pos; 66 | 67 | MOV outTex0, 1; 68 | DP4 outTex0.x, mtex0[0], pos; 69 | DP4 outTex0.y, mtex0[1], pos; 70 | 71 | # Output color. 72 | MOV outColor, inColor; 73 | 74 | END 75 | 76 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/particle_instance_lm.vp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | 3 | # PARTICLE INSTANCE Shader 4 | # screen aligned rotated, fog, 2 texture 5 | # 6 | # worldtransform stored in vertex attrib 7 | # fogcoord: distance to eyeplane 8 | # textures: facemap, shifted along y based on vertexattrib 9 | # 10 | # by Christoph Kubisch 11 | 12 | # Incoming vertex attributes: 13 | ATTRIB inPos = vertex.position; 14 | ATTRIB inTex = vertex.texcoord[0]; 15 | ATTRIB inColor = vertex.attrib[13]; 16 | 17 | ATTRIB inMatrix0 = vertex.attrib[9]; 18 | ATTRIB inMatrix1 = vertex.attrib[10]; 19 | ATTRIB inMatrix2 = vertex.attrib[11]; 20 | 21 | ATTRIB inParams = vertex.attrib[12]; # = { texnum, relage , speed} 22 | 23 | # Outgoing vertex attributes: 24 | OUTPUT outPos = result.position; 25 | OUTPUT outColor = result.color; 26 | OUTPUT outTex0 = result.texcoord[0]; 27 | OUTPUT outTex1 = result.texcoord[1]; 28 | OUTPUT outFog = result.fogcoord; 29 | 30 | # Parameters: 31 | PARAM mvp[4] = { state.matrix.projection }; 32 | PARAM texwidth = program.local[0]; 33 | PARAM mtex0[] = { state.matrix.texture[0].row[0..1] }; 34 | PARAM mtex1[] = { state.matrix.texture[1].row[0..1] }; 35 | PARAM mtexgenS = state.texgen[1].eye.s ; 36 | PARAM mtexgenT = state.texgen[1].eye.t ; 37 | 38 | TEMP pos; # Temporary position. 39 | TEMP rot; # Temporary rotation 40 | 41 | 42 | 43 | # Transform to world 44 | DP4 pos.x, inPos,inMatrix0; 45 | DP4 pos.y, inPos,inMatrix1; 46 | DP4 pos.z, inPos,inMatrix2; 47 | MOV pos.w, 1.0; 48 | 49 | # Transform the vertex to clip space. 50 | DP4 rot.x, mvp[0], pos; 51 | DP4 rot.y, mvp[1], pos; 52 | DP4 rot.z, mvp[2], pos; 53 | DP4 rot.w, mvp[3], pos; 54 | MOV outPos, rot; 55 | 56 | # Output fog 57 | ABS outFog.x, rot.z; 58 | 59 | # texgen for lightmap 60 | MOV outTex1, 1; 61 | DP4 outTex1.x, mtexgenS, pos; 62 | DP4 outTex1.y, mtexgenT, pos; 63 | 64 | # compute outtex 65 | MOV pos,inTex; 66 | ADD pos.x, inParams.xxxw, inTex.xxxw; 67 | MUL pos, pos, texwidth; 68 | 69 | MOV outTex0, 1; 70 | DP4 outTex0.x, mtex0[0], pos; 71 | DP4 outTex0.y, mtex0[1], pos; 72 | 73 | # Output color. 74 | MOV outColor, inColor; 75 | 76 | END 77 | 78 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/projector.vp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | 3 | # PROJECTOR Shader 4 | # 2 textures, fog 5 | # 6 | # used for projective texturing, texcoord generation for texcoords 0,1 7 | # 8 | # by Christoph Kubisch 9 | 10 | # Incoming vertex attributes: 11 | ATTRIB inPos = vertex.position; 12 | 13 | # Outgoing vertex attributes: 14 | OUTPUT outPos = result.position; 15 | OUTPUT outTex0 = result.texcoord[0]; 16 | OUTPUT outTex1 = result.texcoord[1]; 17 | OUTPUT outFog = result.fogcoord; 18 | 19 | PARAM mvp[4] = { state.matrix.mvp }; 20 | PARAM mtexgen0[4] = { state.texgen[0].eye.s, 21 | state.texgen[0].eye.t, 22 | state.texgen[0].eye.r, 23 | state.texgen[0].eye.q}; 24 | PARAM mtexgen1[4] = { state.texgen[1].eye.s, 25 | state.texgen[1].eye.t, 26 | state.texgen[1].eye.r, 27 | state.texgen[1].eye.q}; 28 | PARAM mtex0[4] = { state.matrix.texture[0].row[0..3] }; 29 | PARAM mtex1[4] = { state.matrix.texture[1].row[0..3] }; 30 | 31 | TEMP tex0; 32 | TEMP tex1; 33 | TEMP xfPos; 34 | 35 | 36 | # VIEW TRANSFORMS 37 | # Transform the vertex to clip coordinates. 38 | DP4 xfPos.x, mvp[0], inPos; 39 | DP4 xfPos.y, mvp[1], inPos; 40 | DP4 xfPos.z, mvp[2], inPos; 41 | DP4 xfPos.w, mvp[3], inPos; 42 | MOV outPos, xfPos; 43 | 44 | # Output Fog 45 | ABS outFog.x, xfPos.z; 46 | 47 | # Generate Texcoords 48 | DP4 tex1.x, mtexgen1[0], xfPos; 49 | DP4 tex1.y, mtexgen1[1], xfPos; 50 | DP4 tex1.z, mtexgen1[2], xfPos; 51 | DP4 tex1.w, mtexgen1[3], xfPos; 52 | 53 | DP4 tex0.x, mtexgen0[0], xfPos; 54 | DP4 tex0.y, mtexgen0[1], xfPos; 55 | DP4 tex0.z, mtexgen0[2], xfPos; 56 | DP4 tex0.w, mtexgen0[3], xfPos; 57 | 58 | # Output Tex with texmatrix 59 | DP4 outTex1.x, mtex1[0], tex1; 60 | DP4 outTex1.y, mtex1[1], tex1; 61 | DP4 outTex1.z, mtex1[2], tex1; 62 | DP4 outTex1.w, mtex1[3], tex1; 63 | 64 | DP4 outTex0.x, mtex0[0], tex0; 65 | DP4 outTex0.y, mtex0[1], tex0; 66 | DP4 outTex0.z, mtex0[2], tex0; 67 | DP4 outTex0.w, mtex0[3], tex0; 68 | 69 | END 70 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/skin_weight_unlit.vp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | 3 | # SKIN Shader 4 | # 2 weight skinning, fog, 2 textures 5 | # 6 | # skinning: two weights and matrices per vertex 7 | # fogcoord: distance to eyeplane 8 | # textures: no texgen, no texmatrix 9 | # 10 | # by Christoph Kubisch 11 | 12 | # Incoming vertex attributes: 13 | ATTRIB inPos = vertex.position; 14 | ATTRIB inTex0 = vertex.texcoord[0]; 15 | ATTRIB inTex1 = vertex.texcoord[1]; 16 | ATTRIB inColor = vertex.color; 17 | ATTRIB inIndices = vertex.attrib[7]; 18 | ATTRIB inWeights = vertex.attrib[1]; 19 | 20 | # Outgoing vertex attributes: 21 | OUTPUT outPos = result.position; 22 | OUTPUT outColor = result.color; 23 | OUTPUT outTex0 = result.texcoord[0]; 24 | OUTPUT outTex1 = result.texcoord[1]; 25 | OUTPUT outFog = result.fogcoord; 26 | 27 | PARAM mvp[4] = { state.matrix.mvp }; 28 | PARAM matrices[VID_BONESMAX] = { program.env[0..VID_BONESLAST] }; 29 | TEMP xfPos; 30 | TEMP matx,maty,matz; 31 | ADDRESS arOffset; # Address register used to read offsets. 32 | 33 | # WEIGHT TRANSFORMS 34 | # get weighted matrix 35 | ARL arOffset.x, inIndices.x; 36 | MUL matx, matrices[arOffset.x], inWeights.x; 37 | MUL maty, matrices[arOffset.x+1], inWeights.x; 38 | MUL matz, matrices[arOffset.x+2], inWeights.x; 39 | ARL arOffset.x, inIndices.y; 40 | MAD matx, matrices[arOffset.x], inWeights.y, matx; 41 | MAD maty, matrices[arOffset.x+1], inWeights.y, maty; 42 | MAD matz, matrices[arOffset.x+2], inWeights.y, matz; 43 | 44 | # transform vert 45 | DP4 xfPos.x, matx, inPos; 46 | DP4 xfPos.y, maty, inPos; 47 | DP4 xfPos.z, matz, inPos; 48 | 49 | 50 | # VIEW TRANSFORMS 51 | # Transform the vertex to clip coordinates. 52 | MOV xfPos.w, inPos.w; 53 | DP4 matx.x, mvp[0], xfPos; 54 | DP4 matx.y, mvp[1], xfPos; 55 | DP4 matx.z, mvp[2], xfPos; 56 | DP4 matx.w, mvp[3], xfPos; 57 | MOV outPos, matx; 58 | 59 | # Output Fog 60 | ABS outFog.x, matx.z; 61 | # Output Color 62 | MOV outColor, inColor; 63 | 64 | # Output Tex 65 | MOV outTex1, inTex1; 66 | MOV outTex0, inTex0; 67 | 68 | END 69 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag1.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[1] = { program.local[1] }; 4 | TEMP R0; 5 | TEX R0, fragment.texcoord[0], texture[0], 2D; 6 | MUL R0, R0, c[0]; 7 | ADD R0, R0, bias; 8 | MUL result.color, R0, fragment.color; 9 | END 10 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag1_rect.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[1] = { program.local[1] }; 4 | TEMP R0; 5 | TEX R0, fragment.texcoord[0], texture[0], RECT; 6 | MUL R0, R0, c[0]; 7 | ADD R0, R0, bias; 8 | MUL result.color, R0, fragment.color; 9 | 10 | END 11 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag2.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[2] = { program.local[1..2] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], 2D; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], 2D; 9 | MAD R1, R0, c[1], R1; 10 | ADD R0, R1, bias; 11 | MUL result.color, R0, fragment.color; 12 | END 13 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag2_rect.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[2] = { program.local[1..2] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], RECT; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], RECT; 9 | MAD R1, R0, c[1], R1; 10 | ADD R0, R1, bias; 11 | MUL result.color, R0, fragment.color; 12 | END 13 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag3.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[3] = { program.local[1..3] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], 2D; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], 2D; 9 | MAD R1, R0, c[1], R1; 10 | TEX R0, fragment.texcoord[2], texture[0], 2D; 11 | MAD R1, R0, c[2], R1; 12 | ADD R0, R1, bias; 13 | MUL result.color, R0, fragment.color; 14 | END 15 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag3_rect.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[3] = { program.local[1..3] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], RECT; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], RECT; 9 | MAD R1, R0, c[1], R1; 10 | TEX R0, fragment.texcoord[2], texture[0], RECT; 11 | MAD R1, R0, c[2], R1; 12 | ADD R0, R1, bias; 13 | MUL result.color, R0, fragment.color; 14 | END 15 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag4.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[4] = { program.local[1..4] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], 2D; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], 2D; 9 | MAD R1, R0, c[1], R1; 10 | TEX R0, fragment.texcoord[2], texture[0], 2D; 11 | MAD R1, R0, c[2], R1; 12 | TEX R0, fragment.texcoord[3], texture[0], 2D; 13 | MAD R1, R0, c[3], R1; 14 | ADD R0, R1, bias; 15 | MUL result.color, R0, fragment.color; 16 | END 17 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag4_rect.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[4] = { program.local[1..4] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], RECT; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], RECT; 9 | MAD R1, R0, c[1], R1; 10 | TEX R0, fragment.texcoord[2], texture[0], RECT; 11 | MAD R1, R0, c[2], R1; 12 | TEX R0, fragment.texcoord[3], texture[0], RECT; 13 | MAD R1, R0, c[3], R1; 14 | ADD R0, R1, bias; 15 | MUL result.color, R0, fragment.color; 16 | END 17 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag5.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[5] = { program.local[1..5] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], 2D; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], 2D; 9 | MAD R1, R0, c[1], R1; 10 | TEX R0, fragment.texcoord[2], texture[0], 2D; 11 | MAD R1, R0, c[2], R1; 12 | TEX R0, fragment.texcoord[3], texture[0], 2D; 13 | MAD R1, R0, c[3], R1; 14 | TEX R0, fragment.texcoord[4], texture[0], 2D; 15 | MAD R1, R0, c[4], R1; 16 | ADD R0, R1, bias; 17 | MUL result.color, R0, fragment.color; 18 | END 19 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag5_rect.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[5] = { program.local[1..5] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], RECT; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], RECT; 9 | MAD R1, R0, c[1], R1; 10 | TEX R0, fragment.texcoord[2], texture[0], RECT; 11 | MAD R1, R0, c[2], R1; 12 | TEX R0, fragment.texcoord[3], texture[0], RECT; 13 | MAD R1, R0, c[3], R1; 14 | TEX R0, fragment.texcoord[4], texture[0], RECT; 15 | MAD R1, R0, c[4], R1; 16 | ADD R0, R1, bias; 17 | MUL result.color, R0, fragment.color; 18 | END 19 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag6.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[6] = { program.local[1..6] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], 2D; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], 2D; 9 | MAD R1, R0, c[1], R1; 10 | TEX R0, fragment.texcoord[2], texture[0], 2D; 11 | MAD R1, R0, c[2], R1; 12 | TEX R0, fragment.texcoord[3], texture[0], 2D; 13 | MAD R1, R0, c[3], R1; 14 | TEX R0, fragment.texcoord[4], texture[0], 2D; 15 | MAD R1, R0, c[4], R1; 16 | TEX R0, fragment.texcoord[5], texture[0], 2D; 17 | MAD R1, R0, c[5], R1; 18 | ADD R0, R1, bias; 19 | MUL result.color, R0, fragment.color; 20 | END 21 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag6_rect.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[6] = { program.local[1..6] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], RECT; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], RECT; 9 | MAD R1, R0, c[1], R1; 10 | TEX R0, fragment.texcoord[2], texture[0], RECT; 11 | MAD R1, R0, c[2], R1; 12 | TEX R0, fragment.texcoord[3], texture[0], RECT; 13 | MAD R1, R0, c[3], R1; 14 | TEX R0, fragment.texcoord[4], texture[0], RECT; 15 | MAD R1, R0, c[4], R1; 16 | TEX R0, fragment.texcoord[5], texture[0], RECT; 17 | MAD R1, R0, c[5], R1; 18 | ADD R0, R1, bias; 19 | MUL result.color, R0, fragment.color; 20 | END 21 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag7.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[7] = { program.local[1..7] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], 2D; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], 2D; 9 | MAD R1, R0, c[1], R1; 10 | TEX R0, fragment.texcoord[2], texture[0], 2D; 11 | MAD R1, R0, c[2], R1; 12 | TEX R0, fragment.texcoord[3], texture[0], 2D; 13 | MAD R1, R0, c[3], R1; 14 | TEX R0, fragment.texcoord[4], texture[0], 2D; 15 | MAD R1, R0, c[4], R1; 16 | TEX R0, fragment.texcoord[5], texture[0], 2D; 17 | MAD R1, R0, c[5], R1; 18 | TEX R0, fragment.texcoord[6], texture[0], 2D; 19 | MAD R1, R0, c[6], R1; 20 | ADD R0, R1, bias; 21 | MUL result.color, R0, fragment.color; 22 | END 23 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag7_rect.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[7] = { program.local[1..7] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], RECT; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], RECT; 9 | MAD R1, R0, c[1], R1; 10 | TEX R0, fragment.texcoord[2], texture[0], RECT; 11 | MAD R1, R0, c[2], R1; 12 | TEX R0, fragment.texcoord[3], texture[0], RECT; 13 | MAD R1, R0, c[3], R1; 14 | TEX R0, fragment.texcoord[4], texture[0], RECT; 15 | MAD R1, R0, c[4], R1; 16 | TEX R0, fragment.texcoord[5], texture[0], RECT; 17 | MAD R1, R0, c[5], R1; 18 | TEX R0, fragment.texcoord[6], texture[0], RECT; 19 | MAD R1, R0, c[6], R1; 20 | ADD R0, R1, bias; 21 | MUL result.color, R0, fragment.color; 22 | END 23 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag8.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[8] = { program.local[1..8] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], 2D; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], 2D; 9 | MAD R1, R0, c[1], R1; 10 | TEX R0, fragment.texcoord[2], texture[0], 2D; 11 | MAD R1, R0, c[2], R1; 12 | TEX R0, fragment.texcoord[3], texture[0], 2D; 13 | MAD R1, R0, c[3], R1; 14 | TEX R0, fragment.texcoord[4], texture[0], 2D; 15 | MAD R1, R0, c[4], R1; 16 | TEX R0, fragment.texcoord[5], texture[0], 2D; 17 | MAD R1, R0, c[5], R1; 18 | TEX R0, fragment.texcoord[6], texture[0], 2D; 19 | MAD R1, R0, c[6], R1; 20 | TEX R0, fragment.texcoord[7], texture[0], 2D; 21 | MAD R1, R0, c[7], R1; 22 | ADD R0, R1, bias; 23 | MUL result.color, R0, fragment.color; 24 | END 25 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag8_rect.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[8] = { program.local[1..8] }; 4 | TEMP R0; 5 | TEMP R1; 6 | TEX R0, fragment.texcoord[0], texture[0], RECT; 7 | MUL R1, R0, c[0]; 8 | TEX R0, fragment.texcoord[1], texture[0], RECT; 9 | MAD R1, R0, c[1], R1; 10 | TEX R0, fragment.texcoord[2], texture[0], RECT; 11 | MAD R1, R0, c[2], R1; 12 | TEX R0, fragment.texcoord[3], texture[0], RECT; 13 | MAD R1, R0, c[3], R1; 14 | TEX R0, fragment.texcoord[4], texture[0], RECT; 15 | MAD R1, R0, c[4], R1; 16 | TEX R0, fragment.texcoord[5], texture[0], RECT; 17 | MAD R1, R0, c[5], R1; 18 | TEX R0, fragment.texcoord[6], texture[0], RECT; 19 | MAD R1, R0, c[6], R1; 20 | TEX R0, fragment.texcoord[7], texture[0], RECT; 21 | MAD R1, R0, c[7], R1; 22 | ADD R0, R1, bias; 23 | MUL result.color, R0, fragment.color; 24 | 25 | END 26 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag9.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | 3 | PARAM bias = program.local[0]; 4 | PARAM c[9] = { program.local[1..9] }; 5 | TEMP R0; 6 | TEMP R1; 7 | TEX R0, fragment.texcoord[0].zwzw, texture[0], 2D; 8 | MUL R1, R0, c[1]; 9 | TEX R0, fragment.texcoord[0], texture[0], 2D; 10 | MAD R1, R0, c[0], R1; 11 | TEX R0, fragment.texcoord[1], texture[0], 2D; 12 | MAD R1, R0, c[2], R1; 13 | TEX R0, fragment.texcoord[2], texture[0], 2D; 14 | MAD R1, R0, c[3], R1; 15 | TEX R0, fragment.texcoord[3], texture[0], 2D; 16 | MAD R1, R0, c[4], R1; 17 | TEX R0, fragment.texcoord[4], texture[0], 2D; 18 | MAD R1, R0, c[5], R1; 19 | TEX R0, fragment.texcoord[5], texture[0], 2D; 20 | MAD R1, R0, c[6], R1; 21 | TEX R0, fragment.texcoord[6], texture[0], 2D; 22 | MAD R1, R0, c[7], R1; 23 | TEX R0, fragment.texcoord[7], texture[0], 2D; 24 | MAD R1, R0, c[8], R1; 25 | ADD R0, R1, bias; 26 | MUL result.color, R0, fragment.color; 27 | 28 | END 29 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_frag9_rect.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | PARAM bias = program.local[0]; 3 | PARAM c[9] = { program.local[1..9] }; 4 | TEMP R0; 5 | TEMP R1; 6 | # ATI FIX 7 | MOV R1.xy, fragment.texcoord[0].zwzw; 8 | TEX R0, R1, texture[0], RECT; 9 | # 10 | MUL R1, R0, c[1]; 11 | TEX R0, fragment.texcoord[0], texture[0], RECT; 12 | MAD R1, R0, c[0], R1; 13 | TEX R0, fragment.texcoord[1], texture[0], RECT; 14 | MAD R1, R0, c[2], R1; 15 | TEX R0, fragment.texcoord[2], texture[0], RECT; 16 | MAD R1, R0, c[3], R1; 17 | TEX R0, fragment.texcoord[3], texture[0], RECT; 18 | MAD R1, R0, c[4], R1; 19 | TEX R0, fragment.texcoord[4], texture[0], RECT; 20 | MAD R1, R0, c[5], R1; 21 | TEX R0, fragment.texcoord[5], texture[0], RECT; 22 | MAD R1, R0, c[6], R1; 23 | TEX R0, fragment.texcoord[6], texture[0], RECT; 24 | MAD R1, R0, c[7], R1; 25 | TEX R0, fragment.texcoord[7], texture[0], RECT; 26 | MAD R1, R0, c[8], R1; 27 | ADD R0, R1, bias; 28 | MUL result.color, R0, fragment.color; 29 | END 30 | 31 | -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_vert1.glp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | PARAM c[1] = { program.local[2]}; 3 | PARAM move = program.local[1]; 4 | PARAM scale = program.local[0]; 5 | PARAM mvpmat[4] = { state.matrix.mvp }; 6 | TEMP R0; 7 | MUL R0, vertex.texcoord[0], scale; 8 | ADD R0, R0, move; 9 | ADD result.texcoord[0], R0, c[0]; 10 | DP4 result.position.w, vertex.position, mvpmat[3]; 11 | DP4 result.position.z, vertex.position, mvpmat[2]; 12 | DP4 result.position.y, vertex.position, mvpmat[1]; 13 | DP4 result.position.x, vertex.position, mvpmat[0]; 14 | MOV result.color, vertex.color; 15 | END -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_vert2.glp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | PARAM c[2] = { program.local[2..3]}; 3 | PARAM move = program.local[1]; 4 | PARAM scale = program.local[0]; 5 | PARAM mvpmat[4] = { state.matrix.mvp }; 6 | TEMP R0; 7 | MUL R0, vertex.texcoord[0], scale; 8 | ADD R0, R0, move; 9 | ADD result.texcoord[0], R0, c[0]; 10 | ADD result.texcoord[1], R0, c[1]; 11 | DP4 result.position.w, vertex.position, mvpmat[3]; 12 | DP4 result.position.z, vertex.position, mvpmat[2]; 13 | DP4 result.position.y, vertex.position, mvpmat[1]; 14 | DP4 result.position.x, vertex.position, mvpmat[0]; 15 | MOV result.color, vertex.color; 16 | END -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_vert3.glp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | PARAM c[3] = { program.local[2..4]}; 3 | PARAM move = program.local[1]; 4 | PARAM scale = program.local[0]; 5 | PARAM mvpmat[4] = { state.matrix.mvp }; 6 | TEMP R0; 7 | MUL R0, vertex.texcoord[0], scale; 8 | ADD R0, R0, move; 9 | ADD result.texcoord[0], R0, c[0]; 10 | ADD result.texcoord[1], R0, c[1]; 11 | ADD result.texcoord[2], R0, c[2]; 12 | DP4 result.position.w, vertex.position, mvpmat[3]; 13 | DP4 result.position.z, vertex.position, mvpmat[2]; 14 | DP4 result.position.y, vertex.position, mvpmat[1]; 15 | DP4 result.position.x, vertex.position, mvpmat[0]; 16 | MOV result.color, vertex.color; 17 | END -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_vert4.glp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | PARAM c[4] = { program.local[2..5]}; 3 | PARAM move = program.local[1]; 4 | PARAM scale = program.local[0]; 5 | PARAM mvpmat[4] = { state.matrix.mvp }; 6 | TEMP R0; 7 | MUL R0, vertex.texcoord[0], scale; 8 | ADD R0, R0, move; 9 | ADD result.texcoord[0], R0, c[0]; 10 | ADD result.texcoord[1], R0, c[1]; 11 | ADD result.texcoord[2], R0, c[2]; 12 | ADD result.texcoord[3], R0, c[3]; 13 | DP4 result.position.w, vertex.position, mvpmat[3]; 14 | DP4 result.position.z, vertex.position, mvpmat[2]; 15 | DP4 result.position.y, vertex.position, mvpmat[1]; 16 | DP4 result.position.x, vertex.position, mvpmat[0]; 17 | MOV result.color, vertex.color; 18 | END -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_vert5.glp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | PARAM c[5] = { program.local[2..6]}; 3 | PARAM move = program.local[1]; 4 | PARAM scale = program.local[0]; 5 | PARAM mvpmat[4] = { state.matrix.mvp }; 6 | TEMP R0; 7 | MUL R0, vertex.texcoord[0], scale; 8 | ADD R0, R0, move; 9 | ADD result.texcoord[0], R0, c[0]; 10 | ADD result.texcoord[1], R0, c[1]; 11 | ADD result.texcoord[2], R0, c[2]; 12 | ADD result.texcoord[3], R0, c[3]; 13 | ADD result.texcoord[4], R0, c[4]; 14 | DP4 result.position.w, vertex.position, mvpmat[3]; 15 | DP4 result.position.z, vertex.position, mvpmat[2]; 16 | DP4 result.position.y, vertex.position, mvpmat[1]; 17 | DP4 result.position.x, vertex.position, mvpmat[0]; 18 | MOV result.color, vertex.color; 19 | END -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_vert6.glp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | PARAM c[6] = { program.local[2..7]}; 3 | PARAM move = program.local[1]; 4 | PARAM scale = program.local[0]; 5 | PARAM mvpmat[4] = { state.matrix.mvp }; 6 | TEMP R0; 7 | MUL R0, vertex.texcoord[0], scale; 8 | ADD R0, R0, move; 9 | ADD result.texcoord[0], R0, c[0]; 10 | ADD result.texcoord[1], R0, c[1]; 11 | ADD result.texcoord[2], R0, c[2]; 12 | ADD result.texcoord[3], R0, c[3]; 13 | ADD result.texcoord[4], R0, c[4]; 14 | ADD result.texcoord[5], R0, c[5]; 15 | DP4 result.position.w, vertex.position, mvpmat[3]; 16 | DP4 result.position.z, vertex.position, mvpmat[2]; 17 | DP4 result.position.y, vertex.position, mvpmat[1]; 18 | DP4 result.position.x, vertex.position, mvpmat[0]; 19 | MOV result.color, vertex.color; 20 | END -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_vert7.glp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | PARAM c[7] = { program.local[2..8]}; 3 | PARAM move = program.local[1]; 4 | PARAM scale = program.local[0]; 5 | PARAM mvpmat[4] = { state.matrix.mvp }; 6 | TEMP R0; 7 | MUL R0, vertex.texcoord[0], scale; 8 | ADD R0, R0, move; 9 | ADD result.texcoord[0], R0, c[0]; 10 | ADD result.texcoord[1], R0, c[1]; 11 | ADD result.texcoord[2], R0, c[2]; 12 | ADD result.texcoord[3], R0, c[3]; 13 | ADD result.texcoord[4], R0, c[4]; 14 | ADD result.texcoord[5], R0, c[5]; 15 | ADD result.texcoord[6], R0, c[6]; 16 | DP4 result.position.w, vertex.position, mvpmat[3]; 17 | DP4 result.position.z, vertex.position, mvpmat[2]; 18 | DP4 result.position.y, vertex.position, mvpmat[1]; 19 | DP4 result.position.x, vertex.position, mvpmat[0]; 20 | MOV result.color, vertex.color; 21 | END -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_vert8.glp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | PARAM c[8] = { program.local[2..9]}; 3 | PARAM move = program.local[1]; 4 | PARAM scale = program.local[0]; 5 | PARAM mvpmat[4] = { state.matrix.mvp }; 6 | TEMP R0; 7 | MUL R0, vertex.texcoord[0], scale; 8 | ADD R0, R0, move; 9 | ADD result.texcoord[0], R0, c[0]; 10 | ADD result.texcoord[1], R0, c[1]; 11 | ADD result.texcoord[2], R0, c[2]; 12 | ADD result.texcoord[3], R0, c[3]; 13 | ADD result.texcoord[4], R0, c[4]; 14 | ADD result.texcoord[5], R0, c[5]; 15 | ADD result.texcoord[6], R0, c[6]; 16 | ADD result.texcoord[7], R0, c[7]; 17 | DP4 result.position.w, vertex.position, mvpmat[3]; 18 | DP4 result.position.z, vertex.position, mvpmat[2]; 19 | DP4 result.position.y, vertex.position, mvpmat[1]; 20 | DP4 result.position.x, vertex.position, mvpmat[0]; 21 | MOV result.color, vertex.color; 22 | END -------------------------------------------------------------------------------- /engine/base/gpuprogs/texfilter/texfilter_vert9.glp: -------------------------------------------------------------------------------- 1 | !!ARBvp1.0 2 | PARAM c[9] = { program.local[2..10]}; 3 | PARAM move = program.local[1]; 4 | PARAM scale = program.local[0]; 5 | PARAM mvpmat[4] = { state.matrix.mvp }; 6 | TEMP R0; 7 | MUL R0, vertex.texcoord[0], scale; 8 | ADD R0, R0, move; 9 | ADD result.texcoord[0].zw, R0.xyxy, c[1].xyxy; 10 | ADD result.texcoord[0].xy, R0, c[0]; 11 | ADD result.texcoord[1], R0, c[2]; 12 | ADD result.texcoord[2], R0, c[3]; 13 | ADD result.texcoord[3], R0, c[4]; 14 | ADD result.texcoord[4], R0, c[5]; 15 | ADD result.texcoord[5], R0, c[6]; 16 | ADD result.texcoord[6], R0, c[7]; 17 | ADD result.texcoord[7], R0, c[8]; 18 | DP4 result.position.w, vertex.position, mvpmat[3]; 19 | DP4 result.position.z, vertex.position, mvpmat[2]; 20 | DP4 result.position.y, vertex.position, mvpmat[1]; 21 | DP4 result.position.x, vertex.position, mvpmat[0]; 22 | MOV result.color, vertex.color; 23 | END 24 | 25 | -------------------------------------------------------------------------------- /engine/base/materials/texfilter1.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "texfilter1.shd"; 4 | control "texscale" 0 2; 5 | param "texscale" (1,1,0,1); 6 | control "texmove" 0 2; 7 | param "texmove" (0,0,0,0); 8 | control "weights" 0 4; 9 | param "weights" (0,0,0,0); 10 | control "coords" 0 4; 11 | param "coords" (0,0,0,0); 12 | control "clradd" 0 4; 13 | param "clradd" (0,0,0,0); 14 | } 15 | Texture:0{ 16 | texcontrol "source"; 17 | TEX "?white2D"; 18 | } -------------------------------------------------------------------------------- /engine/base/materials/texfilter2.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "texfilter2.shd"; 4 | control "texscale" 0 2; 5 | param "texscale" (1,1,0,1); 6 | control "texmove" 0 2; 7 | param "texmove" (0,0,0,0); 8 | control "weights" 0 8; 9 | param "weights" (0,0,0,0) 0 2; 10 | control "coords" 0 8; 11 | param "coords" (0,0,0,0) 0 2; 12 | control "clradd" 0 4; 13 | param "clradd" (0,0,0,0); 14 | } 15 | Texture:0{ 16 | texcontrol "source"; 17 | TEX "?white2D"; 18 | } -------------------------------------------------------------------------------- /engine/base/materials/texfilter3.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "texfilter3.shd"; 4 | control "texscale" 0 2; 5 | param "texscale" (1,1,0,1); 6 | control "texmove" 0 2; 7 | param "texmove" (0,0,0,0); 8 | control "weights" 0 12; 9 | param "weights" (0,0,0,0) 0 3; 10 | control "coords" 0 12; 11 | param "coords" (0,0,0,0) 0 3; 12 | control "clradd" 0 4; 13 | param "clradd" (0,0,0,0); 14 | } 15 | Texture:0{ 16 | texcontrol "source"; 17 | TEX "?white2D"; 18 | } -------------------------------------------------------------------------------- /engine/base/materials/texfilter4.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "texfilter4.shd"; 4 | control "texscale" 0 2; 5 | param "texscale" (1,1,0,1); 6 | control "texmove" 0 2; 7 | param "texmove" (0,0,0,0); 8 | control "weights" 0 16; 9 | param "weights" (0,0,0,0) 0 4; 10 | control "coords" 0 16; 11 | param "coords" (0,0,0,0) 0 4; 12 | control "clradd" 0 4; 13 | param "clradd" (0,0,0,0); 14 | } 15 | Texture:0{ 16 | texcontrol "source"; 17 | TEX "?white2D"; 18 | } -------------------------------------------------------------------------------- /engine/base/materials/texfilter5.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "texfilter5.shd"; 4 | control "texscale" 0 2; 5 | param "texscale" (1,1,0,1); 6 | control "texmove" 0 2; 7 | param "texmove" (0,0,0,0); 8 | control "weights" 0 20; 9 | param "weights" (0,0,0,0) 0 5; 10 | control "coords" 0 20; 11 | param "coords" (0,0,0,0) 0 5; 12 | control "clradd" 0 4; 13 | param "clradd" (0,0,0,0); 14 | } 15 | Texture:0{ 16 | texcontrol "source"; 17 | TEX "?white2D"; 18 | } -------------------------------------------------------------------------------- /engine/base/materials/texfilter6.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "texfilter6.shd"; 4 | control "texscale" 0 2; 5 | param "texscale" (1,1,0,1); 6 | control "texmove" 0 2; 7 | param "texmove" (0,0,0,0); 8 | control "weights" 0 24; 9 | param "weights" (0,0,0,0) 0 6; 10 | control "coords" 0 24; 11 | param "coords" (0,0,0,0) 0 6; 12 | control "clradd" 0 4; 13 | param "clradd" (0,0,0,0); 14 | } 15 | Texture:0{ 16 | texcontrol "source"; 17 | TEX "?white2D"; 18 | } -------------------------------------------------------------------------------- /engine/base/materials/texfilter7.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "texfilter7.shd"; 4 | control "texscale" 0 2; 5 | param "texscale" (1,1,0,1); 6 | control "texmove" 0 2; 7 | param "texmove" (0,0,0,0); 8 | control "weights" 0 28; 9 | param "weights" (0,0,0,0) 0 7; 10 | control "coords" 0 28; 11 | param "coords" (0,0,0,0) 0 7; 12 | control "clradd" 0 4; 13 | param "clradd" (0,0,0,0); 14 | } 15 | Texture:0{ 16 | texcontrol "source"; 17 | TEX "?white2D"; 18 | } -------------------------------------------------------------------------------- /engine/base/materials/texfilter8.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "texfilter8.shd"; 4 | control "texscale" 0 2; 5 | param "texscale" (1,1,0,1); 6 | control "texmove" 0 2; 7 | param "texmove" (0,0,0,0); 8 | control "weights" 0 32; 9 | param "weights" (0,0,0,0) 0 8; 10 | control "coords" 0 32; 11 | param "coords" (0,0,0,0) 0 8; 12 | control "clradd" 0 4; 13 | param "clradd" (0,0,0,0); 14 | } 15 | Texture:0{ 16 | texcontrol "source"; 17 | TEX "?white2D"; 18 | } -------------------------------------------------------------------------------- /engine/base/materials/texfilter9.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "texfilter9.shd"; 4 | control "texscale" 0 2; 5 | param "texscale" (1,1,0,1); 6 | control "texmove" 0 2; 7 | param "texmove" (0,0,0,0); 8 | control "weights" 0 36; 9 | param "weights" (0,0,0,0) 0 9; 10 | control "coords" 0 36; 11 | param "coords" (0,0,0,0) 0 9; 12 | control "clradd" 0 4; 13 | param "clradd" (0,0,0,0); 14 | 15 | } 16 | Texture:0{ 17 | texcontrol "source"; 18 | TEX "?white2D"; 19 | } -------------------------------------------------------------------------------- /engine/base/scripts/luxmodules/gui/components/ContainerMover.lua: -------------------------------------------------------------------------------- 1 | ContainerMover = {} 2 | LuxModule.registerclass("gui","ContainerMover", 3 | [[A component that is moving its parent frame if clicked and dragged.]],ContainerMover,{} 4 | ,"Component") 5 | setmetatable(ContainerMover,{__index = Component}) 6 | 7 | 8 | local prv = ContainerMover 9 | 10 | LuxModule.registerclassfunction("new", 11 | [[(ContainerMover):(table class, int x,y,w,h) - 12 | Creates a ContainerMover, which is initially not visible]]) 13 | function ContainerMover.new (class,x,y,w,h) 14 | local self = Component.new(class,x,y,w,h) 15 | self:init() 16 | return self 17 | end 18 | 19 | local function mouseMoved (self,me) 20 | self[prv].sx,self[prv].sy = self[prv].sx or me.x,self[prv].sy or me.y 21 | 22 | if me:isDragged() then 23 | self:lockMouse() 24 | local sx,sy = self[prv].sx,self[prv].sy 25 | local dx,dy = math.floor(me.x-sx+.5),math.floor(me.y-sy+.5) 26 | 27 | 28 | local p =self:getParent() 29 | p:setLocation(p:getX()+dx,p:getY()+dy) 30 | else 31 | self:unlockMouse() 32 | self[prv].sx,self[prv].sy = me.x,me.y 33 | 34 | end 35 | end 36 | 37 | 38 | function ContainerMover:init () 39 | if self.mouseMoved == mouseMoved then return end 40 | self[prv] = self[prv] or {} 41 | self[prv].mouseMoved = rawget(self,"mouseMoved") 42 | self.mouseMoved = mouseMoved 43 | end -------------------------------------------------------------------------------- /engine/base/scripts/luxmodules/gui/components/GroupFrame.lua: -------------------------------------------------------------------------------- 1 | GroupFrame = {} 2 | LuxModule.registerclass("gui","GroupFrame", 3 | [[Groupframes are containers with an initial skin]],GroupFrame,{} 4 | ,"Container") 5 | setmetatable(GroupFrame,{__index = Container}) 6 | 7 | 8 | LuxModule.registerclassfunction("new", 9 | [[(GroupFrame):(table class, int x,y,w,h,[Skin2D skin]) - 10 | creates a container with the given bounds. If no skin is given the 11 | default skin for frames is being used.]]) 12 | function GroupFrame.new (class,x,y,w,h,skin) 13 | local self = Container.new(class,x,y,w,h) 14 | 15 | self:setSkin("default") 16 | 17 | return self 18 | end -------------------------------------------------------------------------------- /engine/base/scripts/luxmodules/gui/components/TextArea.lua: -------------------------------------------------------------------------------- 1 | TextArea = { 2 | pressedskin = "textarea_hover", 3 | hoveredskin = "textarea_hover", 4 | defaultskin = "textarea", 5 | focusedskin = "textarea_hover", 6 | } 7 | setmetatable(TextArea,{__index = Component}) 8 | 9 | LuxModule.registerclass("gui","TextArea", 10 | [[A textarea for textblocks.]],TextArea,{},"Component") 11 | 12 | function TextArea.new(class,x,y,w,h) 13 | local self = Component.new(class,x,y,w,h) 14 | self:addKeyListener( 15 | KeyListener.new(function (kl,keyevent) self:onKeyTyped(keyevent) end, true) 16 | ) 17 | 18 | self.dataTextField = { 19 | text = {}, 20 | cursorpos = 0, 21 | } 22 | 23 | self:setSkin("default") 24 | 25 | return self 26 | end 27 | 28 | function TextArea:createVisibles () 29 | Component.createVisibles(self) 30 | end 31 | 32 | 33 | function TextArea:deleteVisibles () 34 | Component.deleteVisibles() 35 | end 36 | 37 | function TextAray:setVisibility (visible) 38 | Component.setVisibility(visible) 39 | end -------------------------------------------------------------------------------- /engine/base/scripts/luxmodules/gui/components/titleframe.lua: -------------------------------------------------------------------------------- 1 | TitleFrame = { 2 | skinnames = { 3 | defaultskin = "titleframe", 4 | hoveredskin = "titleframe_hover", 5 | pressedskin = "titleframe_pressed", 6 | pressedhoveredskin = "titleframe_hover_pressed", 7 | focusedskin = "titleframe_focus", 8 | focusedhoveredskin = "titleframe_focus_hover", 9 | focusedpressedskin = "titleframe_focus_pressed", 10 | focusedhoveredpressedskin = "titleframe_focus_hover_pressed", 11 | } 12 | } 13 | LuxModule.registerclass("gui","TitleFrame", 14 | [[TitleFrames are containers with an initial skin. Following skinnames are being used: 15 | 16 | * titleframe 17 | * titleframe_hover 18 | * ...]],TitleFrame,{} 19 | ,"Container") 20 | setmetatable(TitleFrame,{__index = Container}) 21 | 22 | 23 | LuxModule.registerclassfunction("new", 24 | [[(TitleFrame):(table class, int x,y,w,h,[Skin2D skin],[string title]) - 25 | creates a container with the given bounds. If no skin is given the 26 | default skin for frames is being used.]]) 27 | function TitleFrame.new (class,x,y,w,h,skin,title) 28 | local self = Container.new(class,x,y,w,h) 29 | 30 | self:setSkin("default") 31 | --self.titlelabel = self:add(Label:new(8,2,w-16,20)) 32 | 33 | self:setTitle(title or "") 34 | self:getSkin():setLabelPosition(10,5) 35 | 36 | return self 37 | end 38 | 39 | LuxModule.registerclassfunction("setTitle", 40 | [[(TitleFrame):(TitleFrame,text) - sets titlecaption]]) 41 | function TitleFrame:setTitle(title) 42 | --self.titlelabel:setText(title) 43 | self:getSkin():setLabelText(title) 44 | end 45 | 46 | LuxModule.registerclassfunction("setTitleAlign", 47 | [[(TitleFrame):(TitleFrame,align) - sets titlecaption alignment. Can be either 48 | Skin2D.ALIGN.LEFT, Skin2D.ALIGN.RIGHT or Skin2D.ALIGN.CENTERED or a number 49 | for the absolute x coordinate.]]) 50 | function TitleFrame:setTitleAlign(align) 51 | self:getSkin():setLabelPosition(align,5) 52 | end 53 | 54 | --function TitleFrame:setBounds(x,y,w,h) 55 | -- self.titlelabel:setSize(w-16,20) 56 | -- Container.setBounds(self,x,y,w,h) 57 | --end 58 | -------------------------------------------------------------------------------- /engine/base/scripts/luxmodules/gui/l2dicon.lua: -------------------------------------------------------------------------------- 1 | L2DIcon = {} 2 | setmetatable(L2DIcon,{__index = Icon}) 3 | LuxModule.registerclass("gui","L2DIcon", 4 | [[]], 5 | L2DIcon, 6 | { 7 | },"Icon") 8 | 9 | LuxModule.registerclassfunction("new", 10 | [[():(class,width, height, oncreate, ondelete) - 11 | ]]) 12 | function L2DIcon.new (class, width, height, oncreate,ondelete) 13 | local self = Icon.new(class,width,height) 14 | 15 | self.oncreate,self.ondelete = oncreate,ondelete 16 | 17 | return self 18 | end 19 | 20 | function L2DIcon:update(reason) 21 | if (not self.l2d) then return end 22 | 23 | if (not self.visibleflag) then 24 | self.l2d:rfNodraw(true) 25 | return 26 | end 27 | 28 | self.l2d:rfNodraw(false) 29 | 30 | 31 | local x,y,w,h = math.floor(self.x),math.floor(self.y),math.floor(self.width),math.floor(self.height) 32 | self.l2d:pos(x,y,self.z) 33 | self.l2d:scale(w,h,1) 34 | self.l2d:sortid(self.id) 35 | 36 | end 37 | 38 | function L2DIcon:setClip(x,y,w,h) 39 | self.cx,self.cy,self.cw,self.ch = x,y,w,h 40 | if (not self.l2d) then return end 41 | if (not x) then 42 | self.l2d:scissor(false) 43 | else 44 | self.l2d:scissor(Component.isClipped()) 45 | self.l2d:scissorparent(true) 46 | self.l2d:scissorsize(w,h) 47 | self.l2d:scissorstart(x,y) 48 | end 49 | end 50 | 51 | function L2DIcon:getClip() 52 | return self.cx,self.cy,self.cw,self.ch 53 | end 54 | 55 | function L2DIcon:createVisibles (l2dparent) 56 | Icon.createVisibles(self,l2dparent) 57 | if (self.l2d) then return end 58 | 59 | self.l2d = l2dnode.new("icon") 60 | 61 | 62 | self.l2d:link(l2dparent) 63 | self.l2d:rfNodepthtest(true) 64 | self.l2d:scissor(Component.isClipped()) 65 | self.l2d:scissorparent(true) 66 | 67 | self:oncreate(self.l2d) 68 | 69 | self:update(Icon.REASON.CREATEDVIS) 70 | end 71 | 72 | function L2DIcon:deleteVisibles() 73 | if (not self.l2d) then return end 74 | self:ondelete() 75 | 76 | self.l2d:delete() 77 | self.l2d = nil 78 | 79 | 80 | self:update(Icon.REASON.DELETEDVIS) 81 | end 82 | 83 | function L2DIcon:clone() 84 | return L2DIcon:new(self.width,self.height,self.oncreate,self.ondelete) 85 | end 86 | 87 | -------------------------------------------------------------------------------- /engine/base/scripts/luxmodules/gui/mod_gui.lua: -------------------------------------------------------------------------------- 1 | LuxModule.register("gui", 2 | [[ 3 | The GUI module handles all kinds of graphical user interface representations 4 | and actions. 5 | 6 | If you want to write your own GUI classes based on the Component class, 7 | you need to call the supermethods of the classes. I.e. if you overload 8 | the mousePressed method of the button, you need to call the mousePressed 9 | method of the button within you method: 10 | 11 | function MyButtonClass:mousePressed(event) 12 | Button.mousePressed(self,event) 13 | -- do your stuff here now 14 | end 15 | 16 | If you forget to do this, your class will not work as expected. 17 | Super-constructors should be called too, ie 18 | 19 | function MyButtonClass.new (class, x,y,w,h, ...) 20 | local self = Button.new(class, x,y,w,h) 21 | -- do your stuff now 22 | end 23 | ]]) 24 | 25 | 26 | dofile("mouse.lua") 27 | dofile("Rectangle.lua") 28 | dofile("icon.lua") 29 | dofile("imageicon.lua") 30 | dofile("l3dicon.lua") 31 | dofile("l2dicon.lua") 32 | dofile("skin2d.lua") 33 | dofile("stretchedimageskin.lua") 34 | dofile "tooltipevent.lua" 35 | dofile("Component.lua") 36 | dofile("Container.lua") 37 | dofile("components/ContainerResizer.lua") 38 | dofile("components/ContainerMover.lua") 39 | dofile("components/Button.lua") 40 | dofile("components/TextField.lua") 41 | dofile("components/Label.lua") 42 | dofile("components/GroupFrame.lua") 43 | dofile("components/titleframe.lua") 44 | dofile("components/ListBox.lua") 45 | dofile("components/ComboBox.lua") 46 | dofile("components/ScrollBar.lua") 47 | -- dofile("components/TextArea.lua") 48 | dofile("components/ImageComponent.lua") 49 | dofile("components/MultiLineLabel.lua") 50 | dofile("components/Slider.lua") 51 | dofile("components/Checkbox.lua") 52 | dofile("components/buttongroup.lua") 53 | dofile("components/TreeView.lua") 54 | 55 | dofile("guihelpers.lua") 56 | -------------------------------------------------------------------------------- /engine/base/scripts/luxmodules/gui/tooltipevent.lua: -------------------------------------------------------------------------------- 1 | class "Tooltipevent" 2 | 3 | function Tooltipevent : Tooltipevent (source, x,y) 4 | self.source = source 5 | local mx,my = MouseCursor.pos() 6 | self.x = x or mx 7 | self.y = y or my 8 | end 9 | 10 | function Tooltipevent : getSource () 11 | return self.source 12 | end 13 | 14 | function Tooltipevent : getMousePos () 15 | return self.x,self.y 16 | end 17 | 18 | function Tooltipevent : getX() 19 | return self.x 20 | end 21 | 22 | function Tooltipevent : getY() 23 | return self.y 24 | end 25 | 26 | function Tooltipevent : consume () 27 | self.consumed = true 28 | end 29 | 30 | function Tooltipevent : isConsumed() 31 | return self.consumed 32 | end 33 | -------------------------------------------------------------------------------- /engine/base/scripts/luxmodules/luxinialuacore/autotable.lua: -------------------------------------------------------------------------------- 1 | AutoTable = {} 2 | LuxModule.registerclass("luxinialuacore","AutoTable", 3 | "The AutoTable class provides a constructor for a table that offers ".. 4 | "a simple way to insert new values. Although the AutoTable object is a ".. 5 | "lua table that can be used like any normal table, you can use the table ".. 6 | "like a function. Any provided argument is inserted at the end of the ".. 7 | "table. In any case, the number of elements of the table is returned.",AutoTable,{}) 8 | function AutoTable.new (copy) 9 | local self = {} 10 | for a,b in pairs(copy or {}) do self[a] = b end 11 | setmetatable(self,AutoTable.metatable) 12 | return self 13 | end 14 | 15 | function AutoTable:onCall (...) 16 | for i=1,select('#',...) do 17 | local c = select(i,...) 18 | if (c) then 19 | table.insert(self,c) 20 | end 21 | end 22 | return table.getn(self) 23 | end 24 | 25 | AutoTable.metatable = {__call = AutoTable.onCall} 26 | -------------------------------------------------------------------------------- /engine/base/scripts/luxmodules/luxinialuacore/debugoutput.lua: -------------------------------------------------------------------------------- 1 | DebugOutput = {} 2 | LuxModule.registerclass("luxinialuacore","DebugOutput", 3 | [[A few helpers to print text on screen quickly. 4 | The output has 10 slots that you can use to print text out. 5 | 6 | Example: 7 | DebugOutput.enable(true) 8 | DebugOutput.set(1,string.format("a = %.2f",math.pi)) 9 | 10 | This will print pi as text on the screen. This is useful i.e. if 11 | you try to figure out good values for angles, rotations, velocities, 12 | etc. during runtime. ]],DebugOutput,{}) 13 | 14 | local l2ds = {} 15 | local x1,y1 = 10,10 16 | 17 | 18 | function DebugOutput.set (i, tx) 19 | assert(type(i)=="number" and i>0 and i<=10,"slotnumber must be >=1 and <=10") 20 | tx = tostring(tx) 21 | if (l2ds[i]) then 22 | l2ds[i]:text(tx) 23 | end 24 | end 25 | 26 | function DebugOutput.enable (on) 27 | if (not on and l2ds[1]) then 28 | l2ds = {} 29 | end 30 | if (on and not l2ds[1]) then 31 | for i=1,10 do 32 | l2ds[i] = l2dtext.new("debugout","",0) 33 | l2ds[i]:parent(l2dlist.getroot()) 34 | l2ds[i]:sortid(100000) 35 | l2ds[i]:spacing(8) 36 | end 37 | DebugOutput.setTopLeft(x1,y1) 38 | end 39 | end 40 | 41 | function DebugOutput.setTopLeft(x,y) 42 | x1,y1 = x,y 43 | for i,v in ipairs(l2ds) do 44 | v:pos(x,y+16*i,0) 45 | end 46 | end 47 | 48 | function DebugOutput.color(r,g,b) 49 | for i,v in ipairs(l2ds) do 50 | v:color(r,g,b,1) 51 | end 52 | end -------------------------------------------------------------------------------- /engine/base/scripts/luxmodules/luxinialuacore/math3d.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/engine/base/scripts/luxmodules/luxinialuacore/math3d.lua -------------------------------------------------------------------------------- /engine/base/scripts/luxmodules/luxinialuacore/viewer_settings.lua: -------------------------------------------------------------------------------- 1 | local refs = {} 2 | local fns = {} 3 | for i=1,4 do refs[i] = {} end 4 | 5 | refs[4][1] = 0.11627907305956 6 | refs[4][2] = 0.11153298616409 7 | refs[4][3] = 0.105204872787 8 | refs[4][4] = 0 9 | 10 | refs[3][1] = "bsp" 11 | refs[3][2] = "ms3d" 12 | refs[3][3] = "3ds" 13 | refs[3][4] = "md3" 14 | refs[3][5] = "obj" 15 | refs[3][6] = "b3d" 16 | refs[3][7] = "fbx" 17 | refs[3][8] = "dae" 18 | 19 | refs[2]["frametime"] = 33.33 20 | refs[2]["cache16"] = false 21 | refs[2]["bincos"] = 0.1 22 | refs[2]["swaxis"] = 1 23 | refs[2]["swrevert"] = 0 24 | refs[2]["stripify"] = false 25 | refs[2]["optimize"] = false 26 | refs[2]["tancos"] = 0.1 27 | refs[2]["nthframe"] = 1 28 | refs[2]["tangents"] = false 29 | refs[2]["swsign"] = 1 30 | refs[2]["nof3d"] = false 31 | refs[2]["convextensions"] = refs[3] 32 | refs[2]["fixcyl"] = false 33 | refs[2]["swflip"] = 0 34 | refs[2]["noma"] = false 35 | refs[2]["keepsky"] = false 36 | 37 | refs[1]["luxf3d"] = refs[2] 38 | refs[1]["bgcolor"] = refs[4] 39 | refs[1]["controlspeed"] = 0.33732292451054 40 | 41 | return refs[1] 42 | -------------------------------------------------------------------------------- /engine/base/scripts/projectmanager/.cvsignore: -------------------------------------------------------------------------------- 1 | projecthistory.lua 2 | -------------------------------------------------------------------------------- /engine/base/shaders/texfilter1.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_VF_TEX4{ 3 | GpuProgram{ 4 | BASE 0 "texfilter/texfilter_vert1.glp"; 5 | param "texscale" 0 VID_VALUE (1,1,0,1); 6 | param "texmove" 1 VID_VALUE (0,0,0,0); 7 | param "coords" 2 VID_VALUE (0,0,0,0); 8 | VPROG; 9 | } 10 | GpuProgram{ 11 | IF:USETEXRECT{ 12 | BASE 0 "texfilter/texfilter_frag1_rect.glp"; 13 | } 14 | ELSE{ 15 | BASE 0 "texfilter/texfilter_frag1.glp"; 16 | } 17 | param "clradd" 0 VID_VALUE (0,0,0,0); 18 | param "weights" 1 VID_VALUE (0,0,0,0); 19 | FPROG; 20 | } 21 | Texture{ 22 | TEX "Texture:0"; 23 | } 24 | } -------------------------------------------------------------------------------- /engine/base/shaders/texfilter2.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_VF_TEX4{ 3 | GpuProgram{ 4 | BASE 0 "texfilter/texfilter_vert2.glp"; 5 | param "texscale" 0 VID_VALUE (1,1,0,1); 6 | param "texmove" 1 VID_VALUE (0,0,0,0); 7 | param "coords" 2 VID_ARRAY (0,0,0,0) 2; 8 | VPROG; 9 | } 10 | GpuProgram{ 11 | IF:USETEXRECT{ 12 | BASE 0 "texfilter/texfilter_frag2_rect.glp"; 13 | } 14 | ELSE{ 15 | BASE 0 "texfilter/texfilter_frag2.glp"; 16 | } 17 | param "clradd" 0 VID_VALUE (0,0,0,0); 18 | param "weights" 1 VID_ARRAY (0,0,0,0) 2; 19 | 20 | FPROG; 21 | } 22 | Texture{ 23 | TEX "Texture:0"; 24 | } 25 | } -------------------------------------------------------------------------------- /engine/base/shaders/texfilter3.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_VF_TEX4{ 3 | GpuProgram{ 4 | BASE 0 "texfilter/texfilter_vert3.glp"; 5 | param "texscale" 0 VID_VALUE (1,1,0,1); 6 | param "texmove" 1 VID_VALUE (0,0,0,0); 7 | param "coords" 2 VID_ARRAY (0,0,0,0) 3; 8 | VPROG; 9 | } 10 | GpuProgram{ 11 | IF:USETEXRECT{ 12 | BASE 0 "texfilter/texfilter_frag3_rect.glp"; 13 | } 14 | ELSE{ 15 | BASE 0 "texfilter/texfilter_frag3.glp"; 16 | } 17 | param "clradd" 0 VID_VALUE (0,0,0,0); 18 | param "weights" 1 VID_ARRAY (0,0,0,0) 3; 19 | FPROG; 20 | } 21 | Texture{ 22 | TEX "Texture:0"; 23 | } 24 | } -------------------------------------------------------------------------------- /engine/base/shaders/texfilter4.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_VF_TEX4{ 3 | GpuProgram{ 4 | BASE 0 "texfilter/texfilter_vert4.glp"; 5 | param "texscale" 0 VID_VALUE (1,1,0,1); 6 | param "texmove" 1 VID_VALUE (0,0,0,0); 7 | param "coords" 2 VID_ARRAY (0,0,0,0) 4; 8 | VPROG; 9 | } 10 | GpuProgram{ 11 | IF:USETEXRECT{ 12 | BASE 0 "texfilter/texfilter_frag4_rect.glp"; 13 | } 14 | ELSE{ 15 | BASE 0 "texfilter/texfilter_frag4.glp"; 16 | } 17 | param "clradd" 0 VID_VALUE (0,0,0,0); 18 | param "weights" 1 VID_ARRAY (0,0,0,0) 4; 19 | FPROG; 20 | } 21 | Texture{ 22 | TEX "Texture:0"; 23 | } 24 | } -------------------------------------------------------------------------------- /engine/base/shaders/texfilter5.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_VF_TEX4{ 3 | GpuProgram{ 4 | BASE 0 "texfilter/texfilter_vert5.glp"; 5 | param "texscale" 0 VID_VALUE (1,1,0,1); 6 | param "texmove" 1 VID_VALUE (0,0,0,0); 7 | param "coords" 2 VID_ARRAY (0,0,0,0) 5; 8 | VPROG; 9 | } 10 | GpuProgram{ 11 | IF:USETEXRECT{ 12 | BASE 0 "texfilter/texfilter_frag5_rect.glp"; 13 | } 14 | ELSE{ 15 | BASE 0 "texfilter/texfilter_frag5.glp"; 16 | } 17 | param "clradd" 0 VID_VALUE (0,0,0,0); 18 | param "weights" 1 VID_ARRAY (0,0,0,0) 5; 19 | FPROG; 20 | } 21 | Texture{ 22 | TEX "Texture:0"; 23 | } 24 | } -------------------------------------------------------------------------------- /engine/base/shaders/texfilter6.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_VF_TEX4{ 3 | GpuProgram{ 4 | BASE 0 "texfilter/texfilter_vert6.glp"; 5 | param "texscale" 0 VID_VALUE (1,1,0,1); 6 | param "texmove" 1 VID_VALUE (0,0,0,0); 7 | param "coords" 2 VID_ARRAY (0,0,0,0) 6; 8 | VPROG; 9 | } 10 | GpuProgram{ 11 | IF:USETEXRECT{ 12 | BASE 0 "texfilter/texfilter_frag6_rect.glp"; 13 | } 14 | ELSE{ 15 | BASE 0 "texfilter/texfilter_frag6.glp"; 16 | } 17 | param "clradd" 0 VID_VALUE (0,0,0,0); 18 | param "weights" 1 VID_ARRAY (0,0,0,0) 6; 19 | FPROG; 20 | } 21 | Texture{ 22 | TEX "Texture:0"; 23 | } 24 | } -------------------------------------------------------------------------------- /engine/base/shaders/texfilter7.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_VF_TEX4{ 3 | GpuProgram{ 4 | BASE 0 "texfilter/texfilter_vert7.glp"; 5 | param "texscale" 0 VID_VALUE (1,1,0,1); 6 | param "texmove" 1 VID_VALUE (0,0,0,0); 7 | param "coords" 2 VID_ARRAY (0,0,0,0) 7; 8 | VPROG; 9 | } 10 | { 11 | GpuProgram{ 12 | IF:USETEXRECT{ 13 | BASE 0 "texfilter/texfilter_frag7_rect.glp"; 14 | } 15 | ELSE{ 16 | BASE 0 "texfilter/texfilter_frag7.glp"; 17 | } 18 | param "clradd" 0 VID_VALUE (0,0,0,0); 19 | param "weights" 1 VID_ARRAY (0,0,0,0) 7; 20 | FPROG; 21 | } 22 | Texture{ 23 | TEX "Texture:0"; 24 | } 25 | } -------------------------------------------------------------------------------- /engine/base/shaders/texfilter8.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_VF_TEX4{ 3 | GpuProgram{ 4 | BASE 0 "texfilter/texfilter_vert8.glp"; 5 | param "texscale" 0 VID_VALUE (1,1,0,1); 6 | param "texmove" 1 VID_VALUE (0,0,0,0); 7 | param "coords" 2 VID_ARRAY (0,0,0,0) 8; 8 | VPROG; 9 | } 10 | GpuProgram{ 11 | IF:USETEXRECT{ 12 | BASE 0 "texfilter/texfilter_frag8_rect.glp"; 13 | } 14 | ELSE{ 15 | BASE 0 "texfilter/texfilter_frag8.glp"; 16 | } 17 | param "clradd" 0 VID_VALUE (0,0,0,0); 18 | param "weights" 1 VID_ARRAY (0,0,0,0) 8; 19 | FPROG; 20 | } 21 | Texture{ 22 | TEX "Texture:0"; 23 | } 24 | } -------------------------------------------------------------------------------- /engine/base/shaders/texfilter9.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_VF_TEX4{ 3 | GpuProgram{ 4 | BASE 0 "texfilter/texfilter_vert9.glp"; 5 | param "texscale" 0 VID_VALUE (1,1,0,1); 6 | param "texmove" 1 VID_VALUE (0,0,0,0); 7 | param "coords" 2 VID_ARRAY (0,0,0,0) 9; 8 | VPROG; 9 | } 10 | GpuProgram{ 11 | IF:USETEXRECT{ 12 | BASE 0 "texfilter/texfilter_frag9_rect.glp"; 13 | } 14 | ELSE{ 15 | BASE 0 "texfilter/texfilter_frag9.glp"; 16 | } 17 | param "clradd" 0 VID_VALUE (0,0,0,0); 18 | param "weights" 1 VID_ARRAY (0,0,0,0) 9; 19 | FPROG; 20 | } 21 | Texture{ 22 | TEX "Texture:0"; 23 | } 24 | } -------------------------------------------------------------------------------- /engine/include/luxinia/reference.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __LUXINIA_REFERENCE_H__ 7 | #define __LUXINIA_REFERENCE_H__ 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | typedef struct lxObjRef_s* lxRef; 14 | typedef int lxResID; 15 | typedef int lxResSubID; 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /engine/source/common/3dmath.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #include "3dmath.h" 7 | #include "../common/common.h" 8 | 9 | ////////////////////////////////////////////////////////////////////////// 10 | // LOCALS 11 | float g_mathfrandtable[MATH_MAX_FRAND]; 12 | static lxFastMathCache_t l_fastmath; 13 | 14 | ////////////////////////////////////////////////////////////////////////// 15 | // Funcs 16 | 17 | void Math_init(){ 18 | int i; 19 | for (i = 0; i < MATH_MAX_FRAND; i++) 20 | g_mathfrandtable[i] = lxFrand(); 21 | 22 | lxFastMath_init(&l_fastmath); 23 | 24 | frandPointer(NULL); 25 | frandPointerSeed(NULL,0); 26 | } 27 | 28 | struct lxFastMathCache_s* Luxinia_getFastMathCache() 29 | { 30 | return &l_fastmath; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /engine/source/common/3dmath.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __3DMATH_H__ 7 | #define __3DMATH_H__ 8 | 9 | #include 10 | #include "../common/types.h" 11 | 12 | ////////////////////////////////////////////////////////////////////////// 13 | // Math LIB 14 | 15 | #define MATH_MAX_FRAND 4096 16 | extern float g_mathfrandtable[MATH_MAX_FRAND]; 17 | 18 | ////////////////////////////////////////////////////////////////////////// 19 | void Math_init(); 20 | 21 | // pseudo random 0-1 float generator 22 | #define randPointerSeed(pt,seed,offset,max) (((((uint)(pt))*(seed))+(offset))%(max)) 23 | #define frandPointer(pt) g_mathfrandtable[(((uint)(pt))*3)%MATH_MAX_FRAND] 24 | #define frandPointerSeed(pt,seed) g_mathfrandtable[(((uint)(pt))*(seed))%MATH_MAX_FRAND] 25 | 26 | 27 | #define lxVector3Unpack(a) ((a)[0]),((a)[1]),((a)[2]) 28 | #define lxVector4Unpack(a) ((a)[0]),((a)[1]),((a)[2]),((a)[3]) 29 | #define lxVector3Compare(a,cmp,b) ( ((a)[0]) cmp ((b)[0]) && ((a)[1]) cmp ((b)[1]) && ((a)[2]) cmp ((b)[2])) 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /engine/source/common/interfaceobjects.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __INTERFACEOBJECT_H__ 7 | #define __INTERFACEOBJECT_H__ 8 | 9 | #include "types.h" 10 | #include "interfaceobjectscom.h" 11 | 12 | typedef struct Matrix44Interface_s 13 | { 14 | int valid; 15 | void *data; 16 | Matrix44InterfaceDef_t funcdef; 17 | 18 | int refCount; 19 | } Matrix44Interface_t; 20 | 21 | 22 | // A Matrix44 Interface pointing to given matrix 23 | // as long as MIF is in use pointer must be valid 24 | // pointer won't be freed on free 25 | Matrix44Interface_t* P4x4Matrix_new(float *matrix); 26 | 27 | 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /engine/source/common/linkedlistprimitives.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #include "linkedlistprimitives.h" 7 | #include "memorymanager.h" 8 | 9 | 10 | ////////////////////////////////////////////////////////////////////////// 11 | // Int2Node 12 | 13 | Int2Node_t* Int2Node_new(int value, int value2){ 14 | Int2Node_t *node = (Int2Node_t*)lxMemGenZalloc(sizeof(Int2Node_t)); 15 | lxListNode_init(node); 16 | node->data = value; 17 | node->data2 = value2; 18 | return node; 19 | } 20 | 21 | void Int2Node_free(Int2Node_t*node){ 22 | lxMemGenFree(node,sizeof(Int2Node_t)); 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /engine/source/common/linkedlistprimitives.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __LINKEDLISTPRIMITIVES_H__ 7 | #define __LINKEDLISTPRIMITIVES_H__ 8 | #include 9 | 10 | typedef struct Int2Node_s { 11 | int data; 12 | int data2; 13 | struct Int2Node_s LUX_LISTNODEVARS; 14 | } Int2Node_t; 15 | 16 | typedef struct Char2PtrNode_s { 17 | char *name; 18 | char *str; 19 | struct Char2PtrNode_s LUX_LISTNODEVARS; 20 | } Char2PtrNode_t; 21 | 22 | ////////////////////////////////////////////////////////////////////////// 23 | // 24 | 25 | Int2Node_t* Int2Node_new(int value, int value2); 26 | void Int2Node_free(Int2Node_t*node); 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /engine/source/common/miscstring.h: -------------------------------------------------------------------------------- 1 | #ifndef __MISCSTRING_H__ 2 | #define __MISCSTRING_H__ 3 | 4 | #include 5 | #include 6 | 7 | //////////////////////////////////////////////////////////////////////////////// 8 | // Namegroup 9 | // Linkedlists that are associated with the same name. 10 | typedef struct NameGroup_s 11 | { 12 | char *name; 13 | void *data; 14 | struct NameGroup_s LISTNODEVARS; 15 | } NameGroup_t; 16 | 17 | NameGroup_t* NameGroup_new(NameGroup_t *group, const char *name, void *data); 18 | NameGroup_t* NameGroup_free(NameGroup_t *group); 19 | 20 | //////////////////////////////////////////////////////////////////////////////// 21 | // NameSpace 22 | // The namespace extends the map by allowing more than one entry per name. 23 | // The members are namegroup objects. 24 | typedef struct NameSpace_s 25 | { 26 | CharStrMapPTR dictionary; 27 | } NameSpace_t; 28 | 29 | NameSpace_t* NameSpace_new(); 30 | NameGroup_t* NameSpace_get(NameSpace_t* self, const char *name); 31 | // adds a new datavalue to the namespace 32 | NameGroup_t* NameSpace_add(NameSpace_t* self, const char *name,void *data); 33 | // renames a datavalue 34 | void NameSpace_rename(NameSpace_t* self, NameGroup_t *object, const char *newname); 35 | // deletes the datavalue and frees object(!) 36 | void NameSpace_freeItem(NameSpace_t* self, NameGroup_t *object); 37 | // frees the namespace and frees the groups 38 | void NameSpace_free(NameSpace_t* self); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /engine/source/common/timer.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #include "timer.h" 7 | #include 8 | #include "../common/common.h" 9 | #include "../main/main.h" 10 | 11 | // GLOBALS 12 | extern LuxTimer_t g_LuxTimer = {0,0,0,0,0}; 13 | 14 | int getFPS() { 15 | return g_LuxTimer.fps; 16 | } 17 | 18 | int getFPSAvg() { 19 | return (int)(1000.0f/(float)g_LuxTimer.avgtimediff); 20 | } 21 | 22 | double getMicros() 23 | { 24 | return (g_LuxiniaWinMgr.luxiGetTime()*1000000.0); 25 | } 26 | 27 | void stopwatch() 28 | { 29 | static double l_timeSW = 0; // time for stopswatch 30 | 31 | if (l_timeSW != 0){ 32 | l_timeSW += getMicros(); 33 | LUX_PRINTF("Stopwatch: %d\n",l_timeSW); 34 | l_timeSW = 0; 35 | } 36 | else 37 | l_timeSW = -getMicros(); 38 | 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /engine/source/common/timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __TIMER_H__ 7 | #define __TIMER_H__ 8 | 9 | 10 | 11 | typedef struct LuxTimer_s{ 12 | unsigned long time; 13 | float timef; 14 | float timediff; 15 | double avgtimediff; 16 | int fps; 17 | }LuxTimer_t; 18 | 19 | extern LuxTimer_t g_LuxTimer; 20 | 21 | int getFPS(); 22 | int getFPSAvg(); 23 | double getMicros(); // return nanosecond time of board, could be wrong at times... 24 | void stopwatch(); // simple stopwatch will print time passed by every second execution 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /engine/source/controls/controls.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __CONTROLS_H__ 7 | #define __CONTROLS_H__ 8 | 9 | #include "../main/main.h" 10 | 11 | typedef enum CtrlKey_e{ 12 | CTRLKEY_QUIT, 13 | CTRLKEY_SCREENSHOTS, 14 | CTRLKEY_CONSOLE, 15 | CTRLKEY_RECORD, 16 | CTRLKEYS 17 | }CtrlKey_t; 18 | 19 | // GLOBALS 20 | typedef struct CtrlInput_s{ 21 | float mousePosition[2]; 22 | }CtrlInput_t; 23 | 24 | extern CtrlInput_t g_CtrlInput; 25 | 26 | void Controls_keyInput(int key, int state,int charcallback); 27 | void Controls_mouseInput(int x, int y); 28 | void Controls_mouseClick(int button, int state); 29 | 30 | void Controls_setCtrlKey(CtrlKey_t key, int state); 31 | int Controls_getCtrlKey(CtrlKey_t key); 32 | 33 | void Controls_setMouseClickCallback(void (*click)(float x, float y, int button, int state)); 34 | void Controls_setMouseMotionCallback(void (*motion)(float x, float y)); 35 | void Controls_setMousePosition(float x, float y); 36 | void Controls_setKeyCallback( void( *func)( int key, int state, int charcallback)); 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /engine/source/fileio/dds.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __DDS_H__ 7 | #define __DDS_H__ 8 | 9 | #include "../resource/texture.h" 10 | 11 | int fileLoadDDS(const char * filename,Texture_t *texture, void *unused); 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /engine/source/fileio/f3d.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/engine/source/fileio/f3d.c -------------------------------------------------------------------------------- /engine/source/fileio/f3d.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __F3D_H__ 7 | #define __F3D_H__ 8 | 9 | #if defined(__cplusplus) 10 | extern "C" 11 | { 12 | #endif 13 | 14 | #define F3D_HEADER 0x1F3D 15 | 16 | 17 | #define F3D_VERSION_23 230 18 | // vertex 52 19 | 20 | #define F3D_VERSION_24 240 21 | // vertex 64_old 22 | 23 | #define F3D_VERSION_25 250 24 | // vertex 64_new 25 | 26 | #define F3D_VERSION_26 260 27 | // ints for (index,vertex)counters, int indices for meshes with vertex count > USHORT 28 | 29 | 30 | 31 | 32 | #include "../common/common.h" 33 | #include "../resource/model.h" 34 | 35 | int fileLoadF3D(const char * filename,Model_t *model, void *unused); 36 | 37 | 38 | #if defined(__cplusplus) 39 | } 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /engine/source/fileio/filesystemcrc32.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __CRCTABLE_H__ 7 | #define __CRCTABLE_H__ 8 | 9 | CRC32entry_t CRC32table[]= 10 | { 11 | {"base/main.lua", 3391496937}, 12 | #ifdef LUX_DEV 13 | {"base/textures/logo1.tga", 2636858941}, 14 | #else 15 | {"base/textures/logo1.tga", 2367177421}, 16 | #endif 17 | {"base/textures/logo2.tga", 73497786}, 18 | { NULL, 0}, 19 | }; 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /engine/source/fileio/jpg.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __JPG_H__ 7 | #define __JPG_H__ 8 | 9 | #include "../resource/texture.h" 10 | 11 | int fileLoadJPG(const char *filename, Texture_t *texture, void *unused); 12 | 13 | int fileSaveJPG(const char * filename, short int width, short int height, int channels, 14 | int quality, unsigned char *imageBuffer); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /engine/source/fileio/log.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __LOG_H__ 7 | #define __LOG_H__ 8 | 9 | #include 10 | 11 | // LOG 12 | #define lnofile(a) lprintf("Could not open file '%s'\n",a) 13 | 14 | // Debug helpers 15 | #ifdef LUX_DEVBUILD 16 | #define dprintf LUX_PRINTF 17 | #define dlprintf lprintf 18 | #else 19 | #define dprintf // 20 | #define dlprintf // 21 | #endif 22 | 23 | // these two print the string to the log 24 | #define lprintf LogPrintf 25 | #define lvprintf LogVPrintf 26 | // these two print the string additionally to the screen 27 | #define bprintf LogPrintf2 28 | #define bvprintf LogVPrintf2 29 | 30 | void LogInit(); 31 | void LogDeinit(); 32 | 33 | // these two print the string to the log 34 | void LogPrintf(char *string, ...); 35 | void LogVPrint(char *string, va_list va); 36 | // these two print the string additionally to the screen 37 | void LogPrintf2(char *string, ...); 38 | void LogVPrintf2(char *string, va_list va); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /engine/source/fileio/ma.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __MA_H__ 7 | #define __MA_H__ 8 | 9 | #include "../common/common.h" 10 | #include "../resource/animation.h" 11 | 12 | #define MA_SIGNATURE ("MotionAnimationASCII") 13 | #define MA_VERSION (100) 14 | 15 | int fileLoadMA(const char *filename,Anim_t *anim, void *unused); 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /engine/source/fileio/mtl.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __MTL_H__ 7 | #define __MTL_H__ 8 | 9 | #include "../common/common.h" 10 | #include "../fileio/parser.h" 11 | #include "../resource/material.h" 12 | 13 | #define MTL_HEADER "luxinia_Material_v%d" 14 | #define MTL_VER_MINIMUM 110 15 | 16 | int fileLoadMTL(const char *filename,Material_t *material,void *unused); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /engine/source/fileio/parser.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __PARSER_H__ 7 | #define __PARSER_H__ 8 | 9 | #include 10 | #include 11 | #include "../common/linkedlistprimitives.h" 12 | #include "../fileio/filesystem.h" 13 | 14 | ////////////////////////////////////////////////////////////////////////// 15 | // FileParse 16 | 17 | typedef booln (FileParseDefineCheck_fn) (char *arg); 18 | typedef Char2PtrNode_t* (FileParseAnnotationAlloc_fn) (const char *str1, const char *str2, size_t str2len); 19 | 20 | typedef struct FileParseDef_s 21 | { 22 | char *stagename; 23 | int onlyonce; 24 | int finishesblock; 25 | int checkend; 26 | int (*fnstage) (char *arg); 27 | }FileParseDef_t; 28 | 29 | enum FileParseDefType_e 30 | { 31 | FPDEF_IF, 32 | FPDEF_ELSEIF, 33 | FPDEF_ELSE, 34 | FPDEF_ANNOTATE, 35 | 36 | FPDEF_USERSTART, 37 | }; 38 | 39 | void FileParse_setDefineCheck(FileParseDefineCheck_fn *func); 40 | void FileParse_setAnnotationAlloc(FileParseAnnotationAlloc_fn *func); 41 | void FileParse_setAnnotationList(Char2PtrNode_t **annotationListHead); 42 | 43 | void FileParse_stage(lxFSFile_t *fMM, char **words,void (*targetfunc)(void*,char*,char*), void* target); // search for goodwords and exec targetfunc 44 | 45 | 46 | // first defs as presented in FPDef 47 | // last def must have NULL as name 48 | void FileParse_start(lxFSFile_t *fMM, FileParseDef_t *defs); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /engine/source/fileio/png.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __PNG_H__ 7 | #define __PNG_H__ 8 | 9 | #include "../resource/texture.h" 10 | 11 | int fileLoadPNG(const char *filename, Texture_t *texture, void *unused); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /engine/source/fileio/prt.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __PRT_H__ 7 | #define __PRT_H__ 8 | 9 | #include "../common/common.h" 10 | #include "../resource/particle.h" 11 | #include "../fileio/parser.h" 12 | 13 | #define PRT_HEADER "luxinia_ParticleSys_v%d" 14 | #define PRT_VER_MINIMUM 120 15 | 16 | int fileLoadPRT(const char *filename,ParticleSys_t *Psys,void *unused); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /engine/source/fileio/shd.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __SHD_H__ 7 | #define __SHD_H__ 8 | 9 | #include "../common/common.h" 10 | #include "../resource/shader.h" 11 | #include "../fileio/parser.h" 12 | 13 | #define SHD_HEADER "luxinia_Shader_v%d" 14 | #define SHD_VER_MINIMUM 310 15 | #define SHD_VER_CGLOADER 310 16 | 17 | int fileLoadSHD(const char *filename,Shader_t *shader,void *unused); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /engine/source/fileio/tga.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __TGA_H__ 7 | #define __TGA_H__ 8 | 9 | #include "../resource/texture.h" 10 | 11 | int fileLoadTGA(const char * filename,Texture_t *texture, void *unused); 12 | 13 | int fileSaveTGA(const char * filename, short int width, short int height, int channels, unsigned char *imageBuffer, int isbgra); 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /engine/source/fnpublish/pubclass_collision.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/engine/source/fnpublish/pubclass_collision.c -------------------------------------------------------------------------------- /engine/source/fnpublish/pubclass_test.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #include "fnpublish.h" 7 | 8 | void PubClass_LuaCore_init () { 9 | FunctionPublish_initClass(LUXI_CLASS_TEST,"testsys", 10 | "The testsys class is for testing purpose such as testing \ 11 | implementations during development of the luxinia core. \ 12 | It is not meant to be published in the release versions of Luxinia.",NULL,0); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /engine/source/fnpublish/pubclass_types.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef PUBLUXI_CLASS_STRUCTS_H_ 7 | #define PUBLUXI_CLASS_STRUCTS_H_ 8 | 9 | #include "fnpublish.h" 10 | #include "../common/reflib.h" 11 | #include "../common/interfaceobjects.h" 12 | 13 | 14 | typedef enum MeshArrayType_e{ 15 | MESHARRAY_L3DMODEL_MESHID, 16 | MESHARRAY_POINTERS, 17 | }MeshArrayType_t; 18 | 19 | typedef struct MeshArrayHandle_s{ 20 | MeshArrayType_t type; 21 | Reference srcref; 22 | union{ 23 | int meshid; 24 | struct{ 25 | void* begin; 26 | int num; 27 | enum VertexType_e vtype; 28 | }ptrs; 29 | }; 30 | }MeshArrayHandle_t; 31 | 32 | Reference MeshArrayHandle_new(MeshArrayHandle_t **out,lxClassType type); 33 | 34 | typedef int (*FnPubFunctionCall_t) (Reference fnref, int upparam1, void *upparam2, int stackargs); 35 | typedef struct FnPubFunction_s { 36 | Reference ref; 37 | FnPubFunctionCall_t fn; 38 | int param1; 39 | void *param2; 40 | } FnPubFunction_t; 41 | 42 | int PubRenderflag_return(enum32 rflag); 43 | 44 | int PubUserMesh(PState pstate, int from, struct Mesh_s **outmesh, lxRrendermesh *outuser); 45 | int PubRenderMesh(PState pstate, int from, struct Mesh_s **outmesh, lxRrendermesh *outuser); 46 | 47 | #endif /*PUBLUXI_CLASS_STRUCTS_H_*/ 48 | -------------------------------------------------------------------------------- /engine/source/luxinia.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/engine/source/luxinia.aps -------------------------------------------------------------------------------- /engine/source/luxinia_architecture.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/engine/source/luxinia_architecture.odg -------------------------------------------------------------------------------- /engine/source/luxinia_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/engine/source/luxinia_architecture.png -------------------------------------------------------------------------------- /engine/source/luxinia_architecture_t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/engine/source/luxinia_architecture_t.png -------------------------------------------------------------------------------- /engine/source/luxinia_engine.txt: -------------------------------------------------------------------------------- 1 | * draw 2 | vistest -> list of visible l3ds per l3dset 3 | l3ddraw 4 | iterate l3dset 5 | update particlesys 6 | iterate l3dview 7 | process rcmds 8 | fill layers 9 | render drawnodes ... 10 | render particles 11 | l2ddraw 12 | consoledraw 13 | * lua think 14 | * sound update 15 | * actor/scenenode update -------------------------------------------------------------------------------- /engine/source/main/luacore.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __LUACORE_H__ 7 | #define __LUACORE_H__ 8 | 9 | #include "../fnpublish/fnpublish.h" 10 | #include 11 | 12 | typedef enum LuaLuxFunctionState_e { 13 | LLF_FINISHED, 14 | LLF_STARTING, 15 | LLF_ARGPUSHING, 16 | LLF_CALLING, 17 | LLF_ARGPOPPING 18 | } LuaLuxFunctionState_t; 19 | 20 | void LuaCore_init(int argn, const char *arg[]); 21 | void LuaCore_think (); 22 | void LuaCore_deinit(); 23 | void LuaCore_setMainState(lua_State* state); 24 | lua_State* LuaCore_getMainState (); 25 | 26 | void LuaCore_callTableFunction(const char *table,const char *funcname); 27 | //void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize); 28 | #endif 29 | -------------------------------------------------------------------------------- /engine/source/main/luxinia.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #include "main.h" 7 | #include "luacore.h" 8 | #include "../render/gl_window.h" 9 | #include "../controls/controls.h" 10 | 11 | LuxiniaWinMgr_t g_LuxiniaWinMgr; 12 | static LuxiniaCallbacks_t l_LuxiniaCallbacks = { 13 | Main_frame, //void (LUXICALL * LUXIframefun)(void); 14 | LuxWindow_reshape, //void (LUXICALL * LUXIwindowsizefun)(int,int); 15 | clearall, //void (LUXICALL * LUXIatexitfun)(void); 16 | Controls_mouseClick, //void (LUXICALL * LUXImousebuttonfun)(int,int); 17 | Controls_mouseInput, //void (LUXICALL * LUXImouseposfun)(int,int); 18 | Controls_keyInput, //void (LUXICALL * LUXIkeyfun)(int,int,int); 19 | //NULL, //void (LUXICALL * LUXImousewheelfun)(int); 20 | }; 21 | 22 | LUXIAPI void Luxina_getCallbacks(LuxiniaCallbacks_t *destination) 23 | { 24 | memcpy(destination,&l_LuxiniaCallbacks,sizeof(LuxiniaCallbacks_t)); 25 | } 26 | 27 | LUXIAPI int Luxina_setWinMgr(const LuxiniaWinMgr_t *source) 28 | { 29 | const void **ptr = (void**)source; 30 | const void **lastptr = ptr+(sizeof(LuxiniaWinMgr_t)/sizeof(void*)); 31 | while (ptr < lastptr){ 32 | if (*ptr == NULL) 33 | return LUXI_FALSE; 34 | ptr++; 35 | } 36 | 37 | memcpy(&g_LuxiniaWinMgr,source,sizeof(LuxiniaWinMgr_t)); 38 | return LUXI_TRUE; 39 | } 40 | 41 | LUXIAPI int Luxina_start(struct lua_State *lstate,const int argc, const char **argv) 42 | { 43 | return Main_start(lstate,argc,argv); 44 | } 45 | LUXIAPI struct lua_State* Luxina_getLuaState(){ 46 | return LuaCore_getMainState(); 47 | } 48 | -------------------------------------------------------------------------------- /engine/source/main/main.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __MAIN_H__ 7 | #define __MAIN_H__ 8 | 9 | #include "../common/common.h" 10 | #include 11 | 12 | #define LUX_BASEPATH "base/" 13 | #define LUX_TASKSTACK 32 14 | #define LUX_AVGTIME 8 15 | 16 | typedef enum LuxTask_e{ 17 | LUX_TASK_MAIN, 18 | LUX_TASK_RENDER, 19 | LUX_TASK_SOUND, 20 | LUX_TASK_LUA, 21 | LUX_TASK_ACTOR, 22 | LUX_TASK_SCENETREE, 23 | LUX_TASK_INPUT, 24 | LUX_TASK_TIMER, 25 | LUX_TASK_EXIT, 26 | LUX_TASK_THINK, 27 | LUX_TASK_RESOURCE, 28 | }LuxTask_t; 29 | 30 | // GLOBALS 31 | extern char *g_projectpath; 32 | extern LuxiniaWinMgr_t g_LuxiniaWinMgr; 33 | 34 | 35 | // luxinia main 36 | void clearall(void); 37 | int main (int, char**); 38 | 39 | void Main_freezeTime(); 40 | 41 | int Main_start(struct lua_State *Lstate,const int argc,const char **argv); 42 | void Main_frame(void); 43 | 44 | void Main_init(); 45 | 46 | // if timediff is greater 0 it will be used, else automatic value 47 | // autoprocess will not perform luathink nor swapbuffers 48 | // drawfirst, then update scenenodes and alike, only affects non-auto mode 49 | void Main_think(float timediff, int autoprocess, int drawfirst); 50 | 51 | void Main_sleep(int timems); 52 | 53 | void Main_startTask(LuxTask_t task); 54 | void Main_endTask(); 55 | 56 | int Main_exit(int nocleanup); 57 | void Main_pause(int state); 58 | 59 | 60 | #endif 61 | 62 | -------------------------------------------------------------------------------- /engine/source/render/gl_draw2d.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __DRAW2D_H__ 7 | #define __DRAW2D_H__ 8 | 9 | #include "gl_drawmesh.h" 10 | 11 | /* 12 | DRAW2D 13 | ------ 14 | 15 | just simple functions to draw textured Quad on screen 16 | 17 | 18 | Author: Christoph Kubisch 19 | 20 | */ 21 | 22 | 23 | // draws a screen image 24 | void Draw_Texture_screen( float x, float y, float z, float w, float h, int texid, int blend, int setproj, enum32 forceflag, enum32 ignoreflag); 25 | void Draw_Texture_cubemap(int texid, float x, float y, float size); 26 | 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /engine/source/render/gl_print.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/engine/source/render/gl_print.c -------------------------------------------------------------------------------- /engine/source/resource/sound.c: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #include "../common/3dmath.h" 7 | #include "sound.h" 8 | #include "resmanager.h" 9 | #include "../fileio/filesystem.h" 10 | 11 | // GLOBALS 12 | int g_nosound = LUX_FALSE; 13 | 14 | 15 | void Sound_clear(Sound_t *sound) 16 | { 17 | 18 | if (sound->buffer) 19 | alDeleteBuffers(1, &sound->buffer); 20 | } 21 | 22 | int Sound_loadFile(const char* filename,Sound_t *tempsnd,void *unused) 23 | { 24 | lxFSFile_t *file; 25 | ALbyte *memory; 26 | 27 | if (g_nosound) 28 | return LUX_TRUE; 29 | 30 | file = FS_open(filename); 31 | if(file == NULL) 32 | { 33 | lprintf("ERROR wavload: "); 34 | lnofile(filename); 35 | return LUX_FALSE; 36 | } 37 | memory = lxFS_getContent(file); 38 | 39 | tempsnd->buffer = alutCreateBufferFromFileImage (lxFS_getContent(file),lxFS_getSize(file)); 40 | FS_close(file); 41 | 42 | if(alGetError() != AL_NO_ERROR){ 43 | return LUX_FALSE; 44 | } 45 | 46 | return LUX_TRUE; 47 | } 48 | 49 | -------------------------------------------------------------------------------- /engine/source/resource/sound.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __SOUND_H__ 7 | #define __SOUND_H__ 8 | 9 | #include 10 | #include "../common/types.h" 11 | 12 | typedef struct Sound_s 13 | { 14 | ResourceInfo_t resinfo; 15 | ALuint buffer; 16 | }Sound_t; 17 | 18 | extern int g_nosound; 19 | 20 | void Sound_clear(Sound_t *sound); 21 | int Sound_loadFile(const char* filename,Sound_t *snd,void *unused); 22 | 23 | #endif 24 | 25 | 26 | -------------------------------------------------------------------------------- /engine/source/scene/actorlist.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef _ACTORLIST_H_ 7 | #define _ACTORLIST_H_ 8 | 9 | #include "../common/common.h" 10 | #include "../scene/linkobject.h" 11 | #include "../scene/vistest.h" 12 | #include "../common/interfaceobjects.h" 13 | #include "../common/reflib.h" 14 | 15 | typedef struct ActorNode_s{ 16 | LinkObject_t link; // must come first 17 | lxMatrix44 internMatrix; 18 | 19 | Matrix44Interface_t *mIFintern; 20 | Matrix44Interface_t *mIFextern; 21 | char *name; 22 | 23 | struct ActorNode_s *prev,*next; 24 | } ActorNode_t; 25 | 26 | void ActorList_init(); 27 | void ActorList_think(); 28 | ActorNode_t* ActorNode_new (const char *name,int drawable,lxVector3 pos); 29 | //void ActorNode_free(ActorNode_t *node); 30 | void RActorNode_free(lxRactornode ref); 31 | Matrix44Interface_t *ActorNode_getMatrixIF(ActorNode_t* self); 32 | void ActorNode_setMatrixIF(ActorNode_t* self,Matrix44Interface_t* mif); 33 | ActorNode_t* ActorNode_get(const char *name); 34 | 35 | int ActorNode_getCount (); 36 | ActorNode_t* ActorNode_getNext (ActorNode_t *node); 37 | ActorNode_t* ActorNode_getPrev (ActorNode_t *node); 38 | ActorNode_t* ActorNode_getFromIndex (int index); 39 | 40 | #endif //_ACTORLIST_H_ 41 | -------------------------------------------------------------------------------- /engine/source/scene/linkobject.h: -------------------------------------------------------------------------------- 1 | #ifndef __LINKOBJECT_H__ 2 | #define __LINKOBJECT_H__ 3 | 4 | #include "../common/common.h" 5 | 6 | typedef enum LinkType_e{ 7 | // first 3 must stay like this 8 | LINK_UNSET = -1, 9 | LINK_S3D = 0, 10 | LINK_ACT = 1, 11 | // only for particles so far 12 | LINK_L3DBONE = 2, 13 | }LinkType_t; 14 | 15 | typedef struct LinkObject_s{ 16 | // 16 DW - 4 DW aligned 17 | lxMatrix44 matrix; 18 | // 4 DW 19 | struct VisObject_s *visobject; 20 | struct Matrix44Interface_s *matrixIF; 21 | lxRef reference; 22 | ulong updframe; 23 | }LinkObject_t; // 20 DW 24 | 25 | typedef struct MatrixLinkObject_s{ 26 | struct Matrix44Interface_s *matrixIF; 27 | }MatrixLinkObject_t; // 2 DW 28 | 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /engine/source/sound/musicfile.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #ifndef __MUSICFILE_H__ 7 | #define __MUSICFILE_H__ 8 | 9 | void Music_load(const char *oggfile); 10 | void Music_play(); 11 | void Music_stop(); 12 | 13 | double Music_getTime(); 14 | void Music_setTime(double t); 15 | 16 | void Music_setGain(double g); 17 | int Music_isPlaying(); 18 | 19 | /* 20 | returns number of available comment fields, char pointer is set to point 21 | to that string (where each string is null terminated). The returned 22 | string is valid until the next call. 23 | */ 24 | int Music_getFileInfo (const char *file, const char ** to); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /engine/source/sound/soundlist.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/engine/source/sound/soundlist.c -------------------------------------------------------------------------------- /engine/source/version.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | // autogenerated version info 7 | // 8 | #define VERXSTR(s) VERSTR(s) 9 | #define VERSTR(s) #s 10 | 11 | 12 | #define LUX_VERSION_MAJOR 1 13 | #define LUX_VERSION_MINOR 500 14 | #define LUX_VERSION_REV 0 15 | 16 | #define LUX_VERSION_FULL LUX_VERSION_MAJOR, LUX_VERSION_MINOR, 0, LUX_VERSION_REV 17 | #define LUX_VERSION_FULLSTR VERXSTR(LUX_VERSION_FULL) 18 | 19 | #if defined(_DEBUG) 20 | #define LUX_VERSION_TYPESTR "Luxinia dbg" 21 | #elif defined(LUX_DEVBUILD) 22 | #define LUX_VERSION_TYPESTR "Luxinia dev" 23 | #else 24 | #define LUX_VERSION_TYPESTR "Luxinia" 25 | #endif 26 | 27 | #define LUX_VERSION (LUX_VERSION_TYPESTR " " VERXSTR(LUX_VERSION_MAJOR) "." VERXSTR(LUX_VERSION_MINOR)) 28 | 29 | -------------------------------------------------------------------------------- /frontends/luxinia_glfw/include/resourcecustom.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2009 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | #define LUXINIA_FRONTEND_TYPE "luxinia_glfw" 6 | -------------------------------------------------------------------------------- /frontends/luxinia_lua/include/resourcecustom.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2009 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | #define LUXINIA_FRONTEND_TYPE "luxinia_lua" 6 | -------------------------------------------------------------------------------- /frontends/luxinia_lua/src/frontend_bindings.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2009 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | #ifndef __LUA_FRONTEND_BINDINGS_H__ 6 | #define __LUA_FRONTEND_BINDINGS_H__ 7 | 8 | // init funcs 9 | struct LuxiniaCallbacks_s * LuaBinding_getLuxiniaCallbacks(); 10 | void LuaBinding_initFrontend(struct lua_State *L); 11 | 12 | 13 | ////////////////////////////////////////////////////////////////////////// 14 | // comm 15 | void LuaBinding_PostInit(); 16 | 17 | int LuaBinding_Print(char*str, char* va_listitem); 18 | void LuaBinding_SetCallbacks( void ); 19 | 20 | // Window handling 21 | int LuaBinding_OpenWindow( int width, int height, int redbits, int greenbits, int bluebits, int alphabits, int depthbits, int stencilbits, int mode ); 22 | void LuaBinding_OpenWindowHint( int target, int hint ); 23 | void LuaBinding_CloseWindow( void ); 24 | void LuaBinding_SetWindowTitle( const char *title ); 25 | void LuaBinding_GetWindowSize( int *width, int *height ); 26 | void LuaBinding_SetWindowSize( int width, int height ); 27 | int LuaBinding_GetWindowPos( int *x, int *y ); 28 | void LuaBinding_SetWindowPos( int x, int y ); 29 | void LuaBinding_SwapBuffers( void ); 30 | int LuaBinding_GetWindowParam( int param ); 31 | void LuaBinding_SetWindowOnTop( int state ); 32 | int LuaBinding_ClientToScreen( int *x, int *y ); 33 | int LuaBinding_ScreenToClient( int *x, int *y ); 34 | void LuaBinding_IconifyWindow( void ); 35 | void LuaBinding_RestoreWindow( void ); 36 | 37 | // Input handling 38 | int LuaBinding_GetKey( int key ); 39 | int LuaBinding_GetMouseButton( int button ); 40 | void LuaBinding_GetMousePos( int *xpos, int *ypos ); 41 | void LuaBinding_SetMousePos( int xpos, int ypos ); 42 | int LuaBinding_GetMouseWheel( void ); 43 | void LuaBinding_SetMouseWheel( int pos ); 44 | 45 | // Enable/disable functions 46 | void LuaBinding_Enable( int token ); 47 | void LuaBinding_Disable( int token ); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /frontends/shared/luastate.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2009 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | #ifndef __LUA_STATE_GETTER_H__ 6 | #define __LUA_STATE_GETTER_H__ 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | // creates and returns same 13 | struct lua_State* LuaState_get( void ); 14 | void LuaState_freeMem( void ); 15 | 16 | // for profiling stats 17 | unsigned int LuaState_getMemUsed( void ); 18 | unsigned int LuaState_getMemAllocated( void ); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | 25 | #endif -------------------------------------------------------------------------------- /frontends/shared/luxinia.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/frontends/shared/luxinia.ico -------------------------------------------------------------------------------- /frontends/shared/luxinia.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "resource.h" 3 | 4 | GLFW_ICON ICON "luxinia.ico" 5 | STRINGTABLE 6 | BEGIN 7 | IDS_FORCEDARGS "" 8 | IDS_PATH_OSUSER "" 9 | IDS_PATH_USERSUB "" 10 | IDS_PATH_SCREENSHOTS "/screenshots" 11 | IDS_PATH_CONFIG "/base" 12 | IDS_PATH_LOG "" 13 | 14 | IDS_CUSTOM_LOGOBIG "base/textures/logo1.tga" 15 | IDS_CUSTOM_LOGOSMALL "base/textures/logo2.tga" 16 | IDS_CUSTOM_LOGOCLEARCOLOR "{0,0,0,0}" 17 | IDS_CUSTOM_LOGOTIME "4000" 18 | END 19 | -------------------------------------------------------------------------------- /frontends/shared/os.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2009 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | #ifndef __OS_HELPERS_H__ 6 | #define __OS_HELPERS__H__ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | int osGetDrives(char ** outnames,int maxnames,int maxlength); 15 | const char* osGetDriveLabel(char *drive); 16 | int osGetDriveSize(char *drive,double *freetocaller, double *total, double *totalfree); 17 | const char* osGetDriveType(char *drive); 18 | const char* osGetOSString( void ); 19 | const char* osGetMACaddress( void ); 20 | void osSwapInterval ( int interval ); // needs GL context bound 21 | void osGetScreenSizeMilliMeters(int *w,int *h); 22 | void osGetScreenRes(int *w, int *h); 23 | unsigned int osGetVideoRam( void ); 24 | void osSetWorkDir(const char* wpath); 25 | 26 | // "userappdata", "userdocs", "commondocs", "commonappdata","exefile","exepath" 27 | const char* osGetPaths(const char *input); 28 | const char* osGetResourceString(unsigned int uID); 29 | 30 | // performs crash analysis (writes minidump,crashdump..) 31 | 32 | typedef void (osErrorPostReport_fn)(const char *reportfilename); 33 | 34 | void osErrorEnableHandler(const char *reportfilename, osErrorPostReport_fn *func); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif -------------------------------------------------------------------------------- /frontends/shared/project.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2009 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | #ifndef __PROJECT_H__ 6 | #define __PROJECT_H__ 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | void ProjectInit(); 15 | const char* ProjectCustomStrings(const char *input); 16 | void ProjectForcedArgs(int *pargc, char ***pargv); 17 | 18 | void ProjectPostErrorDump(const char *filename); 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /frontends/shared/project_win32.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2009 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | #include "project.h" 7 | #include "os.h" 8 | #include "resource.h" 9 | 10 | #ifndef LUX_PLATFORM_WINDOWS 11 | #error "Wrong Platform" 12 | #endif 13 | 14 | 15 | #include 16 | #define WIN32_LEAN_AND_MEAN 17 | #include 18 | #include 19 | #include 20 | 21 | 22 | void ProjectPostErrorDump(const char *filename) 23 | { 24 | //const char *resstring = osGetResourceString(); 25 | // we either have a filename or not (success of write) 26 | 27 | /* 28 | 29 | MessageBox(NULL,_T(""),_T(""), MB_OK | MB_ICONERROR | MB_TASKMODAL); 30 | ShellExecute(0, 31 | "open", 32 | "mailto:" + lcEmailAddress + "?Subject=" + lcSubject + 33 | "&CC=" + lcCCAddress + "&body=" + lcMessageBody, 34 | "", 35 | "",1); 36 | */ 37 | } -------------------------------------------------------------------------------- /frontends/shared/resource.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2004-2009 Christoph Kubisch & Eike Decker 2 | // This file is part of the "Luxinia Engine". 3 | // For conditions of distribution and use, see luxinia.h 4 | 5 | 6 | // Resource File for Luxinia Frontends 7 | #define GLFW_ICON 101 8 | 9 | // forced commandline 10 | #define IDS_FORCEDARGS 201 11 | 12 | // e.g "commondocs","commonappdata" 13 | // "userdocs","userappdata" 14 | // if not set we use working directory as 15 | // main path 16 | #define IDS_PATH_OSUSER 202 17 | 18 | // added to OSUSER (default: "/luxinia") 19 | // or working dir (default: "") 20 | #define IDS_PATH_USERSUB 203 21 | 22 | // added to OSUSERBASE or default 23 | // default is "/screenshots" 24 | #define IDS_PATH_SCREENSHOTS 204 25 | 26 | // default is "/base" 27 | #define IDS_PATH_CONFIG 205 28 | 29 | // default is empty 30 | #define IDS_PATH_LOG 206 31 | 32 | 33 | #define IDS_CRASH_MESSAGE 250 34 | 35 | #define IDS_CRASH_MESSAGE_TITLE 251 36 | 37 | #define IDS_CRASH_EMAIL_ADDR 252 38 | 39 | #define IDS_CRASH_EMAIL_SUBJECT 253 40 | 41 | 42 | 43 | 44 | // warning, dont change logosmall 45 | // in "non-commercial" license 46 | 47 | // "base/textures/logo1.tga" 48 | #define IDS_CUSTOM_LOGOBIG 301 49 | // "base/textures/logo2.tga" 50 | #define IDS_CUSTOM_LOGOSMALL 302 51 | 52 | // "{0,0,0,0}" 53 | #define IDS_CUSTOM_LOGOCLEARCOLOR 303 54 | // "4000" 55 | #define IDS_CUSTOM_LOGOTIME 304 56 | 57 | 58 | -------------------------------------------------------------------------------- /projects/tutorials/.projectinfo.lua: -------------------------------------------------------------------------------- 1 | return { 2 | title = "Tutorials", 3 | description = 4 | "A framework that lets you inspect and run all tutorials", 5 | thumbnail = ".thumbnail.png" 6 | } -------------------------------------------------------------------------------- /projects/tutorials/.thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/.thumbnail.png -------------------------------------------------------------------------------- /projects/tutorials/fxs/particlesys/particle2quads.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_CG_SM4{ 3 | GpuProgram{ 4 | BASE 0 "particlesys.cg" "QuadGeneratorVS"; 5 | param "params" 1 VID_VALUE (8.0,20,20.0,0.1) 0; 6 | VCG; 7 | } 8 | GpuProgram{ 9 | BASE 0 "particlesys.cg" "DummyPS"; 10 | FCG; 11 | } 12 | Texture{ 13 | DUMMY; 14 | texcoord 4; 15 | } 16 | } -------------------------------------------------------------------------------- /projects/tutorials/fxs/postfx/pfx_add2.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "pfx_add2.shd"; 4 | control "weights" 0 8; 5 | param "weights" (0,0,0,0) 0 2; 6 | } 7 | Texture:0{ 8 | texcontrol "source0"; 9 | TEX "?white2D"; 10 | } 11 | Texture:1{ 12 | texcontrol "source1"; 13 | TEX "?white2D"; 14 | } -------------------------------------------------------------------------------- /projects/tutorials/fxs/postfx/pfx_add2.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_VF{ 3 | GpuProgram{ 4 | BASE 0 "pfx_vf.cg" "vert"; 5 | param "texsize0" 0 VID_TEXSIZE (0,0,0,1) 0; 6 | param "texsize1" 0 VID_TEXSIZE (0,0,0,1) 1; 7 | param "texsize2" 0 VID_TEXSIZE (0,0,0,1) 2; 8 | VCG; 9 | } 10 | GpuProgram{ 11 | BASE 0 "pfx_vf.cg" "frag_add2"; 12 | param "weights" 0 VID_ARRAY (0,0,0,0) 2; 13 | FCG; 14 | } 15 | Texture{ 16 | TEX "Texture:0"; 17 | } 18 | Texture{ 19 | TEX "Texture:1"; 20 | } 21 | } -------------------------------------------------------------------------------- /projects/tutorials/fxs/volraycast/volfrontplane.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "volfrontplane.shd"; 4 | control "camattribs" 0 4; 5 | param "camattribs" (1,1,1,1); 6 | control "screen2vol" 0 16; 7 | param "screen2vol" (1,1,1,1) 0 4; 8 | } 9 | -------------------------------------------------------------------------------- /projects/tutorials/fxs/volraycast/volfrontplane.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_CG_SM3_TEX8{ 3 | GpuProgram{ 4 | VCG; 5 | BASE 0 "volpos.cg" "frontplane_v"; 6 | param "screen2vol" 0 VID_ARRAY (0,0,0,1) 4; 7 | param "camattribs" 0 VID_VALUE (0,0,0,1); 8 | } 9 | GpuProgram{ 10 | FCG; 11 | BASE 0 "volpos.cg" "pos_f"; 12 | } 13 | } -------------------------------------------------------------------------------- /projects/tutorials/fxs/volraycast/volpos.cg: -------------------------------------------------------------------------------- 1 | struct vfconn 2 | { 3 | float4 hPos : POSITION; 4 | float4 vPos : TEXCOORD0; 5 | }; 6 | 7 | float4 arraymul(float4 arraymatrix[],int offset, float4 v) 8 | { 9 | float4 outv; 10 | outv.x = dot(v,arraymatrix[0+offset]); 11 | outv.y = dot(v,arraymatrix[1+offset]); 12 | outv.z = dot(v,arraymatrix[2+offset]); 13 | outv.w = dot(v,arraymatrix[3+offset]); 14 | return outv; 15 | } 16 | 17 | vfconn frontplane_v( float4 oPos : POSITION 18 | 19 | ,uniform float4 screen2vol[4] 20 | ,uniform float4 camattribs 21 | ,uniform float4x4 WVP : WORLDVIEWPROJ 22 | ) 23 | { 24 | 25 | vfconn OUT; 26 | 27 | float2 screen = (oPos.xy-0.5)*2*camattribs.xy; 28 | float4 corner = float4(screen.x,camattribs.z,screen.y,1); // 29 | 30 | float4 wPos = arraymul(screen2vol,0,corner); 31 | OUT.vPos = wPos; 32 | OUT.vPos.w = 0.0; 33 | 34 | OUT.hPos = mul(WVP,oPos); 35 | 36 | return OUT; 37 | } 38 | 39 | 40 | vfconn pos_v( float4 oPos : POSITION 41 | ,uniform float4x4 WVP : WORLDVIEWPROJ 42 | ,uniform float4 obj2vol[4] 43 | ) 44 | { 45 | 46 | vfconn OUT; 47 | 48 | OUT.vPos = arraymul(obj2vol,0,oPos); 49 | OUT.vPos.w = 1.0; 50 | 51 | OUT.hPos = mul(WVP,oPos); 52 | 53 | 54 | return OUT; 55 | } 56 | 57 | float4 pos_f( vfconn IN) : COLOR 58 | { 59 | return saturate(IN.vPos); 60 | } -------------------------------------------------------------------------------- /projects/tutorials/fxs/volraycast/volpos.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "volpos.shd"; 4 | control "obj2vol" 0 16; 5 | param "obj2vol" (1,1,1,1) 0 4; 6 | } -------------------------------------------------------------------------------- /projects/tutorials/fxs/volraycast/volpos.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_CG_SM3_TEX8{ 3 | GpuProgram{ 4 | VCG; 5 | BASE 0 "volpos.cg" "pos_v"; 6 | param "obj2vol" 0 VID_ARRAY (0,0,0,1) 4; 7 | } 8 | GpuProgram{ 9 | FCG; 10 | BASE 0 "volpos.cg" "pos_f"; 11 | } 12 | } -------------------------------------------------------------------------------- /projects/tutorials/fxs/volraycast/volraycast.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "volraycast.shd"; 4 | control "control" 0 4; 5 | param "control" (1,1,1,1); 6 | control "campos" 0 3; 7 | param "campos" (1,1,1,1); 8 | control "volscale" 0 3; 9 | param "volscale" (1,1,1,1); 10 | } 11 | Texture:0{ 12 | texcontrol "raystart"; 13 | // dummy values 14 | TEX "?white2D"; 15 | } 16 | Texture:1{ 17 | texcontrol "rayend"; 18 | TEX "?white2D"; 19 | } 20 | Texture:2{ 21 | texcontrol "volume"; 22 | TEX "?white2D"; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /projects/tutorials/fxs/volraycast/volraycast.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_CG_SM3_TEX8{ 3 | GpuProgram{ 4 | VCG; 5 | BASE 0 "volraycast.cg" "main_v"; 6 | } 7 | GpuProgram{ 8 | FCG; 9 | BASE 0 "volraycast.cg" "main_f"; 10 | param "control" 0 VID_VALUE (0,0,0,1); 11 | param "campos" 0 VID_VALUE (0,0,0,1); 12 | param "volscale" 0 VID_VALUE (0,0,0,1); 13 | param "voltexsizeinv" 0 VID_TEXSIZEINV (0,0,0,1) 2; 14 | } 15 | Texture{ 16 | TEX "Texture:0"; 17 | texcoord -1; 18 | } 19 | Texture{ 20 | TEX "Texture:1"; 21 | texcoord -1; 22 | } 23 | Texture{ 24 | TEX "Texture:2"; 25 | texcoord -1; 26 | } 27 | } -------------------------------------------------------------------------------- /projects/tutorials/gpuprogs/common.cg: -------------------------------------------------------------------------------- 1 | // lets use a function for phong-shading 2 | void phong_shading( 3 | // our inputs 4 | float3 normal, float3 toLight, float3 toCam, float specpower, 5 | // and variables we want to write into, or read as well 6 | out float diffuse, inout float4 specular) 7 | { 8 | // diffuse lighting term 9 | // saturate does clamp to [0,1] 10 | diffuse = saturate(dot(normal,toLight)) ; 11 | 12 | // specular term is how much the lightsource 13 | // is reflected to the eye. 14 | // We invert the toCam vector to make it 15 | // "toPos", as reflect function assumes incident 16 | // vectors. 17 | float3 toCamReflected = reflect(-toCam,normal); 18 | 19 | float spec = saturate(dot(toLight,toCamReflected)); 20 | // specularctrl is our control vector, 21 | // we use .w for highlight sharpness 22 | specular *= pow(spec,specpower); 23 | } -------------------------------------------------------------------------------- /projects/tutorials/gpuprogs/localnormalmap.cg: -------------------------------------------------------------------------------- 1 | /* 2 | Local Space Normal Mapping in Luxinia 3 | by Christoph Kubisch 4 | */ 5 | 6 | 7 | 8 | struct AppVertex 9 | { 10 | float4 oPos : POSITION; 11 | float2 tex0 : TEXCOORD0; 12 | #ifdef USEMIRROR 13 | float3 oMirrornormal : ATTR15; 14 | #endif 15 | }; 16 | 17 | 18 | struct VertexOut 19 | { 20 | float4 hPos : POSITION; 21 | float2 tex0 : TEXCOORD0; 22 | float4 oPos : TEXCOORD1; 23 | #ifdef USEMIRROR 24 | float3 oMirrornormal : TEXCOORD2; 25 | #endif 26 | }; 27 | 28 | #include "common.cg" 29 | 30 | VertexOut lit1_v(AppVertex IN, 31 | uniform float4x4 WorldViewProjMatrix 32 | ) 33 | { 34 | VertexOut OUT; 35 | 36 | // transform to screenspace 37 | OUT.hPos = mul(WorldViewProjMatrix, IN.oPos); 38 | 39 | // output other attributes, for fragment-shader 40 | OUT.tex0 = IN.tex0.xy; 41 | OUT.oPos = IN.oPos; 42 | 43 | #ifdef USEMIRROR 44 | OUT.oMirrornormal = IN.oMirrornormal; 45 | #endif 46 | 47 | return OUT; 48 | } 49 | 50 | float4 lit1_f(VertexOut IN, 51 | uniform float4 lightambient, 52 | uniform float4 lightdiffuse, 53 | uniform float4 oLightpos, 54 | uniform float4 oCampos, 55 | uniform sampler2D normalmap : TEXUNIT0) : COLOR 56 | { 57 | float4 texnormal = tex2D(normalmap,IN.tex0)*2-1; 58 | someerror 59 | float3 normal = texnormal.xyz; 60 | 61 | #ifdef USEMIRROR 62 | // reflect normal at mirror 63 | normal -= IN.oMirrornormal*(dot(IN.oMirrornormal,normal)*2); 64 | #endif 65 | normal = normalize(normal); 66 | 67 | // create toLight direction vector 68 | float3 toLight = normalize(oLightpos.xyz-IN.oPos.xyz); 69 | // create toCam direction vector 70 | float3 toCam = normalize(oCampos.xyz-IN.oPos.xyz); 71 | 72 | float diffuse; 73 | float4 specular = float4(1,1,1,1); 74 | 75 | phong_blinn_shading(normal,toLight,toCam,8, 76 | diffuse,specular); 77 | 78 | // final color output 79 | // we mix the lighting terms with lightcolors and 80 | // texturecolors 81 | diffuse *= 0.8; 82 | float4 outcolor = (diffuse*lightdiffuse+lightambient); 83 | /* 84 | #ifdef USEMIRROR 85 | outcolor.xyz = IN.oMirrornormal*0.5+0.5; 86 | #endif 87 | */ 88 | return outcolor; 89 | } 90 | -------------------------------------------------------------------------------- /projects/tutorials/gpuprogs/skyshader.cg: -------------------------------------------------------------------------------- 1 | struct VertexOut 2 | { 3 | float4 tex0 : TEXCOORD0; 4 | float4 tex1 : TEXCOORD1; 5 | float4 tex2 : TEXCOORD2; 6 | float4 tex3 : TEXCOORD3; 7 | }; 8 | 9 | float4 fragment_main(VertexOut IN, 10 | uniform float4 cloudcolor : state.texenv[0].color, 11 | uniform float4 suncolor : state.texenv[1].color, 12 | uniform float4 cloudbrightness : state.texenv[2].color, 13 | 14 | 15 | 16 | uniform sampler2D sampcloud : TEXUNIT0, 17 | uniform sampler2D sampsun : TEXUNIT1, 18 | uniform sampler2D sampbg : TEXUNIT2, 19 | uniform sampler2D sampsundarken :TEXUNIT3) : COLOR 20 | { 21 | float4 colorout; 22 | 23 | 24 | float4 texcloud = tex2D(sampcloud,IN.tex0.xy); 25 | float4 texsun = tex2Dproj(sampsun,IN.tex1.xyz); 26 | float4 texbg = tex2D(sampbg,IN.tex2.xy); 27 | float4 texsundarken = tex2Dproj(sampsundarken,IN.tex3.xyz); 28 | 29 | // cloud color 30 | colorout = (texcloud*cloudcolor)*texbg.w; 31 | // add sun 32 | colorout += suncolor*texcloud.w*texsun.w; 33 | // add bg 34 | colorout += texbg; 35 | // darken clouds 36 | colorout *= (1-(1-(texcloud.w*texsundarken.w))) + cloudbrightness.w; 37 | 38 | return colorout; 39 | } -------------------------------------------------------------------------------- /projects/tutorials/gpuprogs/skyshader.cg.fragment_main^arbfp1.glp: -------------------------------------------------------------------------------- 1 | !!ARBfp1.0 2 | # cgc version 2.0.0012, build date Jan 30 2008 3 | # command line args: -profile arbfp1 4 | # source file: skyshader.cg 5 | #vendor NVIDIA Corporation 6 | #version 2.0.0.12 7 | #profile arbfp1 8 | #program fragment_main 9 | #semantic fragment_main.cloudcolor : state.texenv[0].color 10 | #semantic fragment_main.suncolor : state.texenv[1].color 11 | #semantic fragment_main.cloudbrightness : state.texenv[2].color 12 | #semantic fragment_main.sampcloud : TEXUNIT0 13 | #semantic fragment_main.sampsun : TEXUNIT1 14 | #semantic fragment_main.sampbg : TEXUNIT2 15 | #semantic fragment_main.sampsundarken : TEXUNIT3 16 | #var float4 IN.tex0 : $vin.TEXCOORD0 : TEX0 : 0 : 1 17 | #var float4 IN.tex1 : $vin.TEXCOORD1 : TEX1 : 0 : 1 18 | #var float4 IN.tex2 : $vin.TEXCOORD2 : TEX2 : 0 : 1 19 | #var float4 IN.tex3 : $vin.TEXCOORD3 : TEX3 : 0 : 1 20 | #var float4 cloudcolor : state.texenv[0].color : c[0] : 1 : 1 21 | #var float4 suncolor : state.texenv[1].color : c[1] : 2 : 1 22 | #var float4 cloudbrightness : state.texenv[3].color : c[2] : 3 : 1 23 | #var sampler2D sampcloud : TEXUNIT0 : texunit 0 : 4 : 1 24 | #var sampler2D sampsun : TEXUNIT1 : texunit 1 : 5 : 1 25 | #var sampler2D sampbg : TEXUNIT2 : texunit 2 : 6 : 1 26 | #var sampler2D sampsundarken : TEXUNIT3 : texunit 3 : 7 : 1 27 | #var float4 fragment_main : $vout.COLOR : COL : -1 : 1 28 | PARAM c[3] = { state.texenv[0].color, 29 | state.texenv[1].color, 30 | state.texenv[3].color }; 31 | TEMP R0; 32 | TEMP R1; 33 | TEMP R2; 34 | TEMP R3; 35 | TEMP R4; 36 | TEX R4, fragment.texcoord[0], texture[0], 2D; 37 | TXP R0.w, fragment.texcoord[1], texture[1], 2D; 38 | MUL R1, R4.w, c[1]; 39 | MUL R3, R1, R0.w; 40 | TXP R0.w, fragment.texcoord[3], texture[3], 2D; 41 | TEX R1, fragment.texcoord[2], texture[2], 2D; 42 | MUL R2, R4, c[0]; 43 | MAD R2, R2, R1.w, R3; 44 | MAD R0.x, R4.w, R0.w, c[2].w; 45 | ADD R1, R2, R1; 46 | MUL result.color, R1, R0.x; 47 | END 48 | # 11 instructions, 5 R-regs 49 | -------------------------------------------------------------------------------- /projects/tutorials/materials/chassis.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "1color_cubemapsky.shd"; 4 | } 5 | Texture:0{ 6 | TEX "USER_TEX(carreflect)"; 7 | } -------------------------------------------------------------------------------- /projects/tutorials/materials/leaves.jpg.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "alphatest.shd"; 4 | unlit; 5 | } 6 | Texture:0{ 7 | TEX "leaves.png"; 8 | floatmod "cos" COS 5217 (0.0) 0 0; 9 | floatmod "sin" SIN 7123 (0.0) 0 1; 10 | texmove (0.01,0.01,0); 11 | floatmod "cos" COS 6531 (0.0) 0 2; 12 | texrotate (0,0,3); 13 | texcenter (0.5,0.5,0); 14 | } -------------------------------------------------------------------------------- /projects/tutorials/materials/senior.tga.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader:0{ 3 | SHD "normalmap_full.shd"; 4 | } 5 | Texture:0{ 6 | TEX "senior.any"; 7 | // .any or .ANY is a special extension and will 8 | // take the first bitmap in question 9 | // preferred order is dds,png,jpg,tga 10 | } 11 | Texture:1{ 12 | TEX "senior_localcombined.any"; 13 | } 14 | Texture:2{ 15 | TEX "senior_s.any"; 16 | } 17 | Texture:3{ 18 | TEX "senior_ao.any"; 19 | } -------------------------------------------------------------------------------- /projects/tutorials/materials/sky.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "sky.shd"; 4 | } 5 | Texture:0{ 6 | TEX "nocompress;skycolors.tga"; 7 | texscale (0,1,0); 8 | //floatmod "sky" ADD 5000 (0.1) 0 0; 9 | control "daytime" 0; 10 | texmove (0.25,-0.02,0); 11 | IF:TECH_TEXCOMB_TEX4_COMBINE4{ 12 | control "cloudbrightness" 3; 13 | texconst (1,1,1,0.6); 14 | } 15 | //skymatrix; 16 | } 17 | Texture:1{ 18 | TEX "clouds.png"; 19 | floatmod "cloud" ADD 1000 (0.01) 0 1; 20 | texmove (0,0,0); 21 | texscale (2,2,0); 22 | control "cloudclr" 0 3; 23 | texconst (1,1,1,1); 24 | //cloudmatrix; 25 | } 26 | Texture:2{ 27 | TEX "nocompress;sun1.tga"; 28 | texclamp (1,1,1); 29 | control "sun" 0 3; 30 | 31 | texconst (1,1,1,0.6); 32 | // init matrix for later control 33 | texmatrixc0 (1,0,0,0); 34 | 35 | } 36 | Texture:3{ 37 | TEX "nocompress;sun1.tga"; 38 | texclamp (1,1,1); 39 | // size = 8 40 | // scale = 1/size 41 | // move = (0.5-(scale*0.5)) 42 | texscale (0.125,0.125,1); 43 | texmove (0.4375,0.4375,0); 44 | IF:TECH_TEXCOMB{ 45 | control "cloudbrightness" 3; 46 | texconst (1,1,1,0.6); 47 | } 48 | } 49 | 50 | -------------------------------------------------------------------------------- /projects/tutorials/materials/streetatlas.png.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | Shader{ 3 | SHD "shinyspecular.shd"; 4 | } 5 | Texture:0{ 6 | TEX "streetatlas.png"; 7 | } 8 | -------------------------------------------------------------------------------- /projects/tutorials/materials/t33.mtl: -------------------------------------------------------------------------------- 1 | luxinia_Material_v110 2 | 3 | Shader{ 4 | // just Shader is same as Shader:0, 5 | // which always has to be defined 6 | SHD "3tex_diffspecillum.shd"; 7 | // the shader we want to use 8 | 9 | control "specularctrl" 0 4; 10 | // control objects and modifiers allow us to give 11 | // each instance that uses this material unique values 12 | 13 | // we only want to control all values of the next 14 | // controllable value 15 | // 0 is the start, 4 the length 16 | 17 | param "specularctrl" (1,1,1,8); 18 | // we make this parameter inside the shader unique for this 19 | // material and initialize it with a default value 20 | } 21 | //// FOR TUTORIAL FBO GLOW/MRT 22 | IF:USE_SPLITGLOWSRC{ 23 | // if this resource.condition is true, we will load 24 | // a second shader that can be activated with 25 | // rcmdshaders.shaderstage 26 | Shader:1{ 27 | SHD "3tex_diffspecillum.shd^-DGLOWSRCONLY"; 28 | // we load the shader and also add a Cg Compiler 29 | // preprocessor string, in which we set 30 | // the "//define GLOWSRCONLY" 31 | 32 | // control objects must be unique in name, for entire material, 33 | // so we cant use same name as above 34 | control "specularctrlSplit" 0 4; 35 | param "specularctrl" (1,1,1,8); 36 | } 37 | //// END TUTORIAL FBO GLOW/MRT 38 | } 39 | Texture:0{ 40 | TEX "t33comb.png"; // the combined texture that holds 41 | // specular in the alpha channel 42 | } 43 | Texture:1{ 44 | TEX "t33diff.png"; // only diffuse 45 | } 46 | Texture:2{ 47 | TEX "t33spec.png"; // only specular 48 | } 49 | Texture:3{ 50 | TEX "t33illum.png"; // emissive 51 | } 52 | // only those textures that are really used by a shader 53 | // will be made active -------------------------------------------------------------------------------- /projects/tutorials/models/box.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/box.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/car.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/car.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/car_shadow.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/car_shadow.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/car_wheel_l.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/car_wheel_l.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/car_wheel_r.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/car_wheel_r.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/chiropteradm.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/chiropteradm.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/baum.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/baum.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/baum2.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/baum2.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/baum3.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/baum3.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/baum4.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/baum4.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/baum5.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/baum5.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/baum6.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/baum6.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/busch_inst1.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/busch_inst1.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/busch_inst2.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/busch_inst2.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/grass_inst1.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/grass_inst1.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/grass_inst2.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/grass_inst2.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/stein1.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/stein1.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/stein2.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/stein2.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/stein3.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/stein3.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/stein4.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/stein4.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/stein5.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/stein5.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/enviro/stoneplate.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/enviro/stoneplate.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/lmbox.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/lmbox.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/lmtree.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/lmtree.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/mirroredlocalmap.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/mirroredlocalmap.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/scene.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/scene.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/selector.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/selector.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/senior.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/senior.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/skydome.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/skydome.f3d -------------------------------------------------------------------------------- /projects/tutorials/models/t33.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/models/t33.f3d -------------------------------------------------------------------------------- /projects/tutorials/particles/arrow.prt: -------------------------------------------------------------------------------- 1 | luxinia_ParticleSys_v120 2 | RenderFlag{ 3 | blendmode VID_DECAL; 4 | sort; 5 | } 6 | Emitter{ 7 | type VID_RECTANGLE; 8 | width 10; 9 | height 400; 10 | axis 2; 11 | //size 400; 12 | spread (5,15); 13 | velocity 150; 14 | velocityvar 50; 15 | rate 700; 16 | count 3000; 17 | } 18 | Particle{ 19 | type VID_QUAD; 20 | size 30; 21 | sizevar 10; 22 | life 1500; 23 | lifevar 500; 24 | rotatevelocity; 25 | } 26 | Color{ 27 | numcolor 3; 28 | RGBA 10 (1.0,1.0,0.04,1.0); 29 | RGBA 60 (1.0,0.2,0.04,1.0); 30 | RGBA 90 (0.8,0.3,0.1,0.1); 31 | interpolate; 32 | } 33 | Texture{ 34 | numtex 1; 35 | TEX 0 "arrow.tga"; 36 | } 37 | Forces{ 38 | //gravity (200.0,150.0,150.0) 0; 39 | } 40 | -------------------------------------------------------------------------------- /projects/tutorials/plugins/cudatest.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/plugins/cudatest.dll -------------------------------------------------------------------------------- /projects/tutorials/plugins/cudatest/buildvc8/cudatest.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 9.00 2 | # Visual Studio 2005 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cudatest", "cudatest.vcproj", "{BB3AEE03-BA31-4940-9DCB-3FDA13B9FCC5}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Win32 = Debug|Win32 8 | Release|Win32 = Release|Win32 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {BB3AEE03-BA31-4940-9DCB-3FDA13B9FCC5}.Debug|Win32.ActiveCfg = Debug|Win32 12 | {BB3AEE03-BA31-4940-9DCB-3FDA13B9FCC5}.Debug|Win32.Build.0 = Debug|Win32 13 | {BB3AEE03-BA31-4940-9DCB-3FDA13B9FCC5}.Release|Win32.ActiveCfg = Release|Win32 14 | {BB3AEE03-BA31-4940-9DCB-3FDA13B9FCC5}.Release|Win32.Build.0 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /projects/tutorials/plugins/cudatest/buildvc8/simpleGL_kernel.linkinfo: -------------------------------------------------------------------------------- 1 | --import %laneid,%ctaid,%nctaid,%smid,A7,%pm3,%pm2,%pm1,__CC-temp__0__,%pm0,%tid,%clock,%warpid,%ntid,%gridid --export _Z6kernelP15Vertex16Color_sjjf -------------------------------------------------------------------------------- /projects/tutorials/plugins/cudatest/readme.txt: -------------------------------------------------------------------------------- 1 | Based on the simpleGL nvidia cuda demo. 2 | 3 | To build you need CUDA environment variables 4 | (typically set by installer) 5 | CUDA_BIN_PATH 6 | CUDA_LIB_PATH 7 | CUDA_INC_PATH 8 | 9 | You need to set path to CUDA SDK yourself 10 | CUDA_SDK_PATH 11 | 12 | Part of Luxinia Public SDK 13 | 14 | LUXINIA_INC (containing a Lua subdirectory with Lua headers) 15 | LUXINIA_LIB (containing lua5.1.lib in /x86/windows/msvc8) 16 | 17 | 18 | To launch the pugin in debug mode you need: 19 | LUXPROJECTS (path to directory that hosts the luxinia projects) 20 | LUXINIA (path to exe) 21 | -------------------------------------------------------------------------------- /projects/tutorials/plugins/minimal/buildcb/minimal.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 57 | 58 | -------------------------------------------------------------------------------- /projects/tutorials/plugins/minimal/buildcb/minimal.workspace: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /projects/tutorials/plugins/minimal/buildvc8/minimal.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minimal", "minimal.vcproj", "{E0A8D130-F026-4A05-82AA-BBC803BC39F0}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {E0A8D130-F026-4A05-82AA-BBC803BC39F0}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {E0A8D130-F026-4A05-82AA-BBC803BC39F0}.Debug|Win32.Build.0 = Debug|Win32 14 | {E0A8D130-F026-4A05-82AA-BBC803BC39F0}.Release|Win32.ActiveCfg = Release|Win32 15 | {E0A8D130-F026-4A05-82AA-BBC803BC39F0}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /projects/tutorials/plugins/minimal/src/minimal.cpp: -------------------------------------------------------------------------------- 1 | 2 | // includes, system 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | // include LUA 9 | #define LIBAPI __declspec(dllexport) 10 | 11 | #if defined(__cplusplus) 12 | extern "C" 13 | { 14 | #endif 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | LIBAPI int luaopen_minimal(lua_State *L); 21 | 22 | #if defined(__cplusplus) 23 | } 24 | #endif 25 | 26 | static int sum(lua_State *L) 27 | { 28 | 29 | int stacksize = lua_gettop(L); 30 | lua_Number summed = 0; 31 | 32 | if (stacksize < 1){ 33 | lua_pushstring(L,"at least 1 number required"); 34 | lua_error(L); 35 | return 1; 36 | } 37 | 38 | for (int i = 1; i <= stacksize; i++){ 39 | lua_Number add = luaL_checknumber(L,i); 40 | summed += add; 41 | } 42 | 43 | lua_pushnumber(L,summed); 44 | 45 | return 1; 46 | } 47 | 48 | static const struct luaL_reg minimallib[] = { 49 | {"sum", sum}, 50 | {NULL, NULL}, 51 | }; 52 | 53 | 54 | LIBAPI int luaopen_minimal(lua_State *L) { 55 | // openlib pushes a table on top of the lua stack 56 | // into which the functions were registered 57 | luaL_openlib (L, "minimal", minimallib, 0); 58 | 59 | // and tell lua that we returned a table on the stack 60 | return 1; 61 | } 62 | -------------------------------------------------------------------------------- /projects/tutorials/shaders/1color_cubemapsky.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_DEFAULT{ 3 | Texture 4 | { 5 | // texturecolor * vertexcolor (maybe lit or not) 6 | VTEX "Texture:0"; 7 | 8 | // a special texture coordinate generator for cubemaps 9 | // useful for reflections 10 | skyreflectmap; 11 | } 12 | } -------------------------------------------------------------------------------- /projects/tutorials/shaders/alphatest.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | 3 | RenderFlag{ 4 | nocull; 5 | unlit; 6 | nocolorarray; 7 | alphafunc GL_GREATER (0.3); 8 | alphaTEX "Texture:0"; 9 | } 10 | Texture{ 11 | VTEX "Texture:0"; 12 | } -------------------------------------------------------------------------------- /projects/tutorials/shaders/normalmap_full.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_VF_TEX4{ 3 | GpuProgram{ 4 | BASE 0 "tangentnormalmap.cg" "lit1_v"; 5 | VCG; 6 | tangents; 7 | param "lightpos" 1 VID_LIGHTPOS (0,0,0,1.0) 0; 8 | param "campos" 2 VID_CAMPOS (0,0,0,1.0); 9 | } 10 | GpuProgram{ 11 | BASE 0 "tangentnormalmap.cg" "lit1_f"; 12 | param "lightambient" 1 VID_LIGHTAMBIENT (0,0,0,1.0) 0; 13 | param "lightdiffuse" 1 VID_LIGHTCOLOR (0,0,0,1.0) 0; 14 | param "ambiocclusion" 1 VID_VALUE (2,-0.5,1,0); 15 | FCG; 16 | } 17 | Texture{ 18 | TEX "Texture:0"; 19 | } 20 | Texture{ 21 | TEX "Texture:1"; 22 | texcoord -1; 23 | } 24 | Texture{ 25 | TEX "Texture:2"; 26 | texcoord -1; 27 | } 28 | Texture{ 29 | TEX "Texture:3"; 30 | texcoord -1; 31 | } 32 | } 33 | Technique:VID_DEFAULT{ 34 | Texture{ 35 | TEX "Texture:0"; 36 | } 37 | Texture{ 38 | TEX "Texture:3"; 39 | blendmode VID_DECAL_CONST; 40 | param "ambiocclusion" 1 VID_VALUE (2,-0.5,0,0); 41 | } 42 | Texture{ 43 | TEX "Texture:1"; 44 | blendmode VID_NORMALMAPTAN; 45 | } 46 | } -------------------------------------------------------------------------------- /projects/tutorials/shaders/normalmap_local.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_VF_TEX4{ 3 | GpuProgram{ 4 | BASE 0 "localnormalmap.cg" "lit1_v"; 5 | VCG; 6 | IF:USEMIRROR{ 7 | tangents; 8 | } 9 | } 10 | GpuProgram{ 11 | BASE 0 "localnormalmap.cg" "lit1_f"; 12 | param "lightambient" 1 VID_LIGHTAMBIENT (0,0,0,1.0) 0; 13 | param "lightdiffuse" 1 VID_LIGHTCOLOR (0,0,0,1.0) 0; 14 | param "oLightpos" 1 VID_LIGHTPOS (0,0,0,1.0) 0; 15 | param "oCampos" 2 VID_CAMPOS (0,0,0,1.0); 16 | FCG; 17 | } 18 | Texture{ 19 | TEX "Texture:0"; 20 | } 21 | } 22 | Technique:VID_ARB_TEXCOMB{ 23 | Texture{ 24 | TEX "Texture:0"; 25 | 26 | // pass light direction (object space) 27 | // as const color 28 | 29 | param "lightdir" 1 VID_LIGHTDIR (0,0,0,1.0) 0; 30 | 31 | // simply dot3 normalmap with lightdir 32 | blendmode VIDTC_DOT3:TEX.C|CONST.C 33 | } 34 | } -------------------------------------------------------------------------------- /projects/tutorials/shaders/normalmap_onlyspec.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_VF_TEX4{ 3 | GpuProgram{ 4 | BASE 0 "tangentnormalmap.cg" "lit1_v"; 5 | VCG; 6 | tangents; 7 | param "lightpos" 1 VID_LIGHTPOS (0,0,0,1.0) 0; 8 | param "campos" 2 VID_CAMPOS (0,0,0,1.0); 9 | } 10 | GpuProgram{ 11 | BASE 0 "tangentnormalmap.cg" "spec1_f"; 12 | FCG; 13 | } 14 | Texture{ 15 | TEX "Texture:1"; 16 | } 17 | Texture{ 18 | TEX "Texture:2"; 19 | texcoord -1; 20 | } 21 | } 22 | Technique:VID_DEFAULT{ 23 | Texture{ 24 | TEX "Texture:2"; 25 | blendmode VID_REPLACE; 26 | } 27 | Texture{ 28 | SPECULAR; 29 | sunreflectmap; 30 | blendmode VID_MODULATE; 31 | } 32 | } -------------------------------------------------------------------------------- /projects/tutorials/shaders/ppl_color_spec.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | 3 | NewPass{ 4 | blendmode VID_REPLACE; 5 | } 6 | Texture{ 7 | param "texconst" 0 VID_TEXCONST0 (0,0,0,1); 8 | blendmode VID_REPLACE_CONST; 9 | //SPECULAR; 10 | //blendmode VID_AMOD_VERTEX; 11 | //sunreflectmap; 12 | } 13 | -------------------------------------------------------------------------------- /projects/tutorials/shaders/shinyspecular.shd: -------------------------------------------------------------------------------- 1 | luxinia_Shader_v310 2 | Technique:VID_ARB_TEXCOMB{ 3 | Texture{ 4 | VTEX "Texture:0"; 5 | } 6 | Texture{ 7 | SPECULAR; 8 | sunreflectmap; 9 | blendmode VID_AMODADD_PREV; 10 | } 11 | } 12 | Technique:VID_DEFAULT{ 13 | Texture{ 14 | VTEX "Texture:0"; 15 | } 16 | } -------------------------------------------------------------------------------- /projects/tutorials/textures/Box01NormalsMap.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/Box01NormalsMap.tga -------------------------------------------------------------------------------- /projects/tutorials/textures/arrow.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/arrow.tga -------------------------------------------------------------------------------- /projects/tutorials/textures/buildblock1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/buildblock1.jpg -------------------------------------------------------------------------------- /projects/tutorials/textures/carshadow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/carshadow.jpg -------------------------------------------------------------------------------- /projects/tutorials/textures/clouds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/clouds.png -------------------------------------------------------------------------------- /projects/tutorials/textures/explosprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/explosprite.png -------------------------------------------------------------------------------- /projects/tutorials/textures/grasstile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/grasstile.jpg -------------------------------------------------------------------------------- /projects/tutorials/textures/grastex1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/grastex1.tga -------------------------------------------------------------------------------- /projects/tutorials/textures/grastex2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/grastex2.tga -------------------------------------------------------------------------------- /projects/tutorials/textures/grastex3.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/grastex3.tga -------------------------------------------------------------------------------- /projects/tutorials/textures/leaves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/leaves.png -------------------------------------------------------------------------------- /projects/tutorials/textures/lightmap_chiropteradm_0.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/lightmap_chiropteradm_0.tga -------------------------------------------------------------------------------- /projects/tutorials/textures/lightmap_chiropteradm_1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/lightmap_chiropteradm_1.tga -------------------------------------------------------------------------------- /projects/tutorials/textures/lightmap_chiropteradm_2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/lightmap_chiropteradm_2.tga -------------------------------------------------------------------------------- /projects/tutorials/textures/senior.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/senior.jpg -------------------------------------------------------------------------------- /projects/tutorials/textures/senior_ao.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/senior_ao.jpg -------------------------------------------------------------------------------- /projects/tutorials/textures/senior_localcombined.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/senior_localcombined.jpg -------------------------------------------------------------------------------- /projects/tutorials/textures/senior_s.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/senior_s.jpg -------------------------------------------------------------------------------- /projects/tutorials/textures/skycolors.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/skycolors.tga -------------------------------------------------------------------------------- /projects/tutorials/textures/stein.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/stein.jpg -------------------------------------------------------------------------------- /projects/tutorials/textures/streetatlas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/streetatlas.png -------------------------------------------------------------------------------- /projects/tutorials/textures/sun1.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/sun1.tga -------------------------------------------------------------------------------- /projects/tutorials/textures/t33comb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/t33comb.png -------------------------------------------------------------------------------- /projects/tutorials/textures/t33diff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/t33diff.png -------------------------------------------------------------------------------- /projects/tutorials/textures/t33illum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/t33illum.png -------------------------------------------------------------------------------- /projects/tutorials/textures/t33small.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/t33small.tga -------------------------------------------------------------------------------- /projects/tutorials/textures/t33spec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/t33spec.png -------------------------------------------------------------------------------- /projects/tutorials/textures/tech_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/tech_01.jpg -------------------------------------------------------------------------------- /projects/tutorials/textures/tech_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/tech_02.jpg -------------------------------------------------------------------------------- /projects/tutorials/textures/tech_03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/tech_03.jpg -------------------------------------------------------------------------------- /projects/tutorials/textures/tech_04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/tech_04.jpg -------------------------------------------------------------------------------- /projects/tutorials/textures/tree.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/tree.jpg -------------------------------------------------------------------------------- /projects/tutorials/textures/treeshadow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/textures/treeshadow.jpg -------------------------------------------------------------------------------- /projects/tutorials/tutorial20-zip/main.lua: -------------------------------------------------------------------------------- 1 | -- Object picking 2 | 3 | -- 4 | -- models/t33.f3d 5 | 6 | -- basic scene 7 | view = UtilFunctions.simplerenderqueue() 8 | view.rClear:colorvalue(0.0,0.0,0.0,0) 9 | 10 | actor = actornode.new("t33",0,10,0) 11 | actor:rotdeg(40,-20,40) 12 | t33 = model.load("t33.f3d") 13 | actor.l3d = l3dmodel.new("t33",t33) 14 | actor.l3d:linkinterface(actor) 15 | 16 | -- picking collision 17 | pickspace = dspacehash.new() -- our space containing 18 | -- all pickable geometry 19 | t33.coldata = UtilFunctions.getModelColMesh(t33).data 20 | -- the t33 is the model and we store the coldata 21 | -- in the model reference. The utilfunction extracts 22 | -- everything we need 23 | actor.geom = dgeomtrimesh.new(t33.coldata,pickspace) 24 | actor.geom:pos(actor:pos()) -- we need to transform 25 | -- the geom in the same way as the actor does! 26 | actor.geom:rotaxis(actor:rotaxis()) 27 | actor.geom.identifier = "Hello World" -- an identificator 28 | 29 | input.showmouse(true) 30 | 31 | pickresult = actornode.new("pickres") 32 | pickresult.l3d = l3dprimitive.newcylinder("pick",.03,.03,1) 33 | pickresult.l3d:linkinterface(pickresult) 34 | pickresult.l3d:color(1,0,0,1) 35 | 36 | function picking () 37 | local geom, pos,norm = UtilFunctions.picktest(pickspace) 38 | -- if not passed, it will automaticly use the 39 | -- default camera and the mouse coordinates 40 | if geom then -- we've had a hit 41 | pickresult:pos(unpack(pos)) 42 | pickresult:lookat(pos[1]+norm[1],pos[2]+norm[2],pos[3]+norm[3], 43 | 0,0,1,2) -- let the cylinder look into the direction 44 | -- of the normal. The last argument is telling that 45 | -- the Z axis should be used for orientation 46 | print(geom.identifier) -- print the identifier of 47 | -- the picked object 48 | end 49 | end 50 | 51 | Timer.set("tutorial",picking,20) -------------------------------------------------------------------------------- /projects/tutorials/tutorial20-zip/models/t33.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/tutorial20-zip/models/t33.f3d -------------------------------------------------------------------------------- /projects/tutorials/tutorial20-zip/textures/t33small.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/tutorial20-zip/textures/t33small.tga -------------------------------------------------------------------------------- /projects/tutorials/tutorial20-zip/tutorial20-zip.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/tutorial20-zip/tutorial20-zip.zip -------------------------------------------------------------------------------- /projects/tutorials/tutorials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pixeljetstream/luxinia1/5d69b2d47d5ed4501dc155cfef999475f2fdfe2a/projects/tutorials/tutorials.png -------------------------------------------------------------------------------- /projects/tutorials/tutorialstodo.txt: -------------------------------------------------------------------------------- 1 | TODO: 2 | ----- 3 | 4 | Local: 5 | ------ 6 | 7 | Z T026 - custom dll (actually cuda plugin serves this?) 8 | Z T031 - 2dphysics 9 | 10 | C T030 - normalmap local + mirror 11 | C T033 - normalmap tangent 12 | 13 | C Txxx - dynparticles (forum-know-how) 14 | C Txxx - heightmap terrain (forum-know-how) 15 | C Txxx - tile terrain (demo) 16 | 17 | --- 18 | C Txxx - water reflection + skyscene 19 | C Txxx - simple shaders (forum-know-how) 20 | 21 | C Txxx - simple height-map terrain (forum-know-how) 22 | C Txxx - terrain + detailobjs (forum-know-how) 23 | 24 | C Txxx - animation playback (beretta shooting) 25 | C Txxx - Bone IK (forum-know-how) 26 | 27 | C Txxx - luxf3d/modelviewer (forum-know-how) 28 | 29 | 30 | Web: 31 | ---- 32 | Z T010 - reg expr. (Local ??) 33 | Z T011 - oo programming (Local ??) 34 | Z T013 - obj management (Local ??) 35 | Z T015 - zbuffer 36 | 37 | Z T026 - dll 38 | Z T027 - threads 39 | Z T031 - 2dphysics 40 | Z T032 - user textures 41 | Z T034 - static particle placement 42 | 43 | C T025 - postfx convolution 44 | C T028 - lvlmodel 45 | 46 | C T024 - fbo glow mrt 47 | C T029 - vehicle ref 48 | C T030 - local normalmap 49 | C T033 - tangent normalmap 50 | 51 | C Txxx - dynparticles 52 | C Txxx - heightmap terrain 53 | C Txxx - tile terrain -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/Shared/advrendering.lua: -------------------------------------------------------------------------------- 1 | 2 | function ARCreateStaticVBOs(vtype,vertcount,indexcount,doallocs) 3 | 4 | local vsize = vtype:memsize()*vertcount 5 | local vbo = vidbuffer.new(vidtype.vertex(),vidhint.draw(1), 6 | vsize) 7 | 8 | 9 | -- indices are either 16bit or 32bit depending on vertexcount 10 | local is16bit = vertcount <= 65536 11 | local isize = (is16bit and 2 or 4)*indexcount 12 | local ibo = vidbuffer.new(vidtype.index(),vidhint.draw(1), 13 | isize) 14 | 15 | 16 | if (doallocs) then 17 | ibo:localalloc(isize) 18 | vbo:localalloc(vsize) 19 | end 20 | 21 | return vbo,ibo,is16bit 22 | end 23 | 24 | -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/Shared/camcontrols.lua: -------------------------------------------------------------------------------- 1 | function CCaddRot(camact) 2 | local mcon = Container:new(0,0,window.refsize()) 3 | local mx,my = 0,0 4 | local listener = MouseListener.new( 5 | function (self,me) 6 | local root = Container.getRootContainer() 7 | if me:isPressed() then 8 | mx,my = me.x,me.y 9 | MouseCursor.pos(mx,my) 10 | mcon:lockMouse() 11 | return 12 | end 13 | if me:isDragged() and not me:isPressed() and Component.getMouseLock() == mcon then 14 | local dx,dy = me.x-mx,me.y-my 15 | if dx==0 and dy==0 then return end 16 | MouseCursor.pos(mx,my) 17 | local a,b,c = camact:rotdeg() 18 | camact:rotdeg(math.max(-90,math.min(90,a-dy*0.5)),b,c-dx*0.5) 19 | elseif not me:isPressed() then 20 | mcon:unlockMouse() 21 | end 22 | end 23 | ) 24 | 25 | 26 | mcon:addMouseListener(listener) 27 | Container.getRootContainer():add(mcon) 28 | 29 | function mcon:onParentLayout(nx,ny,nw,nh) 30 | self:setBounds(nx,ny,nw,nh) 31 | end 32 | 33 | return mcon 34 | end 35 | 36 | -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/Shared/htmllabels.lua: -------------------------------------------------------------------------------- 1 | -- html doc 2 | function HLconverthtmlpage (page) 3 | page = page:match("(.*)") 4 | page = page:gsub("
\n","
") 5 | page = page:gsub("\n"," ") 6 | repeat 7 | local n 8 | page,n = page:gsub("%s%s"," ") 9 | until n == 0 10 | page = page:gsub(" "," ") 11 | page = page:gsub("
","\n") 12 | page = page:gsub("(.-)",function (ln,tx) return "$$link"..ln:gsub("'",""):gsub('"','').."$$\v009"..tx.."$$link$$\v000" end) 13 | return page:gsub("^%s*(.*)%s*$","%1") -- trim the string 14 | end 15 | 16 | function HLgetdocpage (file,title) 17 | local path = system.projectpath().."tutscripts/"..file 18 | local fp = io.open(path) 19 | local tx = (fp:read("*a") or "") 20 | fp:close() 21 | 22 | local t = tx:match("(.+)") or file 23 | 24 | if title then title:setText(" "..t) end 25 | 26 | return HLconverthtmlpage(tx),t 27 | end 28 | 29 | function HLaction (title,actions) 30 | 31 | return function (self,what,mouseevent,zone) 32 | if zone and what == "clicked" then 33 | local fn = zone.description:match("function:(.+)") 34 | if fn then return actions[fn]() end 35 | self:setText(HLgetdocpage(zone.description,title)) 36 | 37 | self.prevzone = nil 38 | self.prevzonetext = nil 39 | return 40 | end 41 | if zone~=self.prevzone and self.prevzone then 42 | self.prevzone.l2d:text(self.prevzonetext) 43 | self.prevzone = nil 44 | end 45 | if zone and self.prevzone~=zone then 46 | if prevzone then 47 | prevzone.l2d:text(self.prevzonetext) 48 | end 49 | self.prevzone = zone 50 | local text = zone.l2d:text() 51 | self.prevzonetext = text 52 | text = text:gsub("\v990","\v009") 53 | local front,link,back = text:sub(0,zone.strstart), 54 | text:sub(zone.strstart+1,zone.strend),text:sub(zone.strend+1) 55 | --print(link) 56 | link = link:gsub("\v009","\v900") 57 | text = front..link..back 58 | zone.l2d:text(text) 59 | end 60 | end 61 | 62 | end -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/T002-basicscene.lua: -------------------------------------------------------------------------------- 1 | -- Basic scene, a simple lit sphere 2 | 3 | view = UtilFunctions.simplerenderqueue() 4 | view.rClear:colorvalue(0.0,0.0,0.0,0) 5 | 6 | -- a sphere 7 | actor = actornode.new("actor",0,10,0) 8 | actor.l3d = l3dprimitive.newsphere("sphere",1,1,1) 9 | actor.l3d:linkinterface(actor) 10 | actor.l3d:rfLitSun(true) 11 | 12 | -- sunlight 13 | mysun = actornode.new("sun",100,200,600) 14 | mysun.light = l3dlight.new("light") 15 | mysun.light:linkinterface(mysun) 16 | mysun.light:makesun() 17 | 18 | mysun.light:diffuse(.8,.5,0,1) 19 | mysun.light:ambient(.1,.2,.5,1) 20 | 21 | -- camera 22 | cam = actornode.new("camera",0,5,5) 23 | l3dcamera.default():linkinterface(cam) 24 | cam:lookat(0,10,0, 0,0,1) 25 | 26 | -- movement for camera 27 | function moveit () 28 | local t = os.clock() 29 | local x,y = math.sin(t) * 10,math.cos(t)*10 30 | cam:pos(x,y,5) 31 | cam:lookat(0,10,0,0,0,1) 32 | end 33 | 34 | Timer.set("tutorial",moveit,20) 35 | -- movit is now called every 20 milliseconds 36 | 37 | -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/T003-inputhandling.lua: -------------------------------------------------------------------------------- 1 | -- Basic scene, keyboard controls the sphere 2 | 3 | -- scene setup like in tutorial 002 4 | view = UtilFunctions.simplerenderqueue() 5 | view.rClear:colorvalue(0.0,0.0,0.0,0) 6 | 7 | actor = actornode.new("actor",0,0,0) 8 | actor.l3d = l3dprimitive.newsphere("box",1,1,1) 9 | actor.l3d:linkinterface(actor) 10 | actor.l3d:rfLitSun(true) 11 | 12 | mysun = actornode.new("sun",100,200,600) 13 | mysun.light = l3dlight.new("light") 14 | mysun.light:linkinterface(mysun) 15 | mysun.light:makesun() 16 | 17 | cam = actornode.new("camera",3,5,2) 18 | l3dcamera.default():linkinterface(cam) 19 | cam:lookat(0,0,0,0,0,1) 20 | 21 | -- this function polls the input state 22 | function think () 23 | local left = Keyboard.isKeyDown("LEFT") 24 | local right = Keyboard.isKeyDown("RIGHT") 25 | local up = Keyboard.isKeyDown("UP") 26 | local down = Keyboard.isKeyDown("DOWN") 27 | local fx = (left and 1 or 0) - (right and 1 or 0) 28 | local fy = (up and 1 or 0) - (down and 1 or 0) 29 | -- fx,fy: movement directions 30 | local x,y,z = actor:pos() 31 | actor:pos(x+fx*.1,y+fy*.1,z) 32 | end 33 | 34 | Timer.set("tutorial",think,20) -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/T006-model.lua: -------------------------------------------------------------------------------- 1 | -- Loading and showing a .f3d model 2 | 3 | -- 4 | -- models/t33.f3d 5 | 6 | view = UtilFunctions.simplerenderqueue() 7 | view.rClear:colorvalue(0.0,0.0,0.0,0) 8 | 9 | actor = actornode.new("t33",0,10,0) 10 | actor:rotdeg(40,-20,40) 11 | t33 = model.load("t33.f3d") 12 | actor.l3d = l3dmodel.new("t33",t33) 13 | actor.l3d:linkinterface(actor) -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/T007-picking.lua: -------------------------------------------------------------------------------- 1 | -- Object picking 2 | 3 | -- 4 | -- models/t33.f3d 5 | 6 | -- basic scene 7 | view = UtilFunctions.simplerenderqueue() 8 | view.rClear:colorvalue(0.0,0.0,0.0,0) 9 | 10 | actor = actornode.new("t33",0,10,0) 11 | actor:rotdeg(40,-20,40) 12 | local t33 = model.load("t33.f3d") 13 | actor.l3d = l3dmodel.new("t33",t33) 14 | actor.l3d:linkinterface(actor) 15 | 16 | -- picking collision 17 | pickspace = dspacehash.new() -- our space containing 18 | -- all pickable geometry 19 | local coldata = UtilFunctions.getModelColMesh(t33).data 20 | -- the t33 is the model and we store the coldata 21 | -- temporarily. The utilfunction extracts 22 | -- everything we need. 23 | 24 | -- Create a dgeomtrimesh from the data, so we 25 | -- can make hit tests with it. dgeomtrimesh prevents 26 | -- garbage collection of coldata. 27 | 28 | actor.geom = dgeomtrimesh.new(coldata,pickspace) 29 | actor.geom:pos(actor:pos()) -- we need to transform 30 | -- the geom in the same way as the actor does! 31 | actor.geom:rotaxis(actor:rotaxis()) 32 | actor.geom.identifier = "Hello World" -- an identificator 33 | 34 | input.showmouse(true) 35 | 36 | pickresult = actornode.new("pickres") 37 | pickresult.l3d = l3dprimitive.newcylinder("pick",.03,.03,1) 38 | pickresult.l3d:linkinterface(pickresult) 39 | pickresult.l3d:color(1,0,0,1) 40 | 41 | function picking () 42 | local geom, pos,norm = UtilFunctions.picktest(pickspace) 43 | -- if not passed, it will automaticly use the 44 | -- default camera and the mouse coordinates 45 | if geom then -- we've had a hit 46 | pickresult:pos(unpack(pos)) 47 | pickresult:lookat(pos[1]+norm[1],pos[2]+norm[2],pos[3]+norm[3], 48 | 0,0,1,2) -- let the cylinder look into the direction 49 | -- of the normal. The last argument is telling that 50 | -- the Z axis should be used for orientation 51 | print(geom.identifier) -- print the identifier of 52 | -- the picked object 53 | end 54 | end 55 | 56 | Timer.set("tutorial",picking,20) -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/T014-frustum_l3d.lua: -------------------------------------------------------------------------------- 1 | -- Frustum check l3dnode parent 2 | 3 | view = UtilFunctions.simplerenderqueue() 4 | view.rClear:colorvalue(1.0,1.0,1,0) 5 | 6 | snode = scenenode.new("sn") -- just create a new one 7 | 8 | function l3d(l3d,x,y,z) 9 | l3d:rfLitSun(true) 10 | l3d:localpos(x or 0, y or 0, z or 0) 11 | return l3d 12 | end 13 | 14 | snode.l3d = l3d(l3dprimitive.newsphere("s1",1)) 15 | snode.l3d:linkinterface(snode) 16 | 17 | snode.l3d.box = l3d(l3dprimitive.newbox("b1",.5,3,1),0,1.5,0) 18 | snode.l3d.box:parent(snode.l3d) 19 | 20 | snode.l3d.box.cyl = l3d(l3dprimitive.newcylinder("c1",.5,.5,5),0,1.5,0) 21 | snode.l3d.box.cyl:parent(snode.l3d.box) 22 | 23 | snode.l3d.box.box = l3d(l3dprimitive.newbox("b2",3,.5,.5),1.5,0,0) 24 | snode.l3d.box.box:parent(snode.l3d.box) 25 | 26 | snode:vistestbbox(-1,-1,-2.5,3,3.5,2.5) 27 | 28 | --- some scene setup for our camera / lighting 29 | cam = actornode.new("cam") 30 | l3dcamera.default():linkinterface(cam) 31 | cam:pos(10,10,35) 32 | cam:lookat(0,0,0,0,0,1) 33 | 34 | sun = actornode.new("sun",100,40,200) 35 | sun.light = l3dlight.new("sun") 36 | sun.light:makesun() 37 | sun.light:linkinterface(sun) 38 | 39 | render.drawvisspace(2) 40 | 41 | -- only for cleanup stuff used in the tutorial framework 42 | return function() render.drawvisspace(0) end -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/T014-frustum_spatial.lua: -------------------------------------------------------------------------------- 1 | -- Frustum check spatialnodes 2 | 3 | view = UtilFunctions.simplerenderqueue() 4 | view.rClear:colorvalue(1.0,1.0,1,0) 5 | 6 | function buildscene (adder) -- constructs a scene, 7 | -- independent from the used scenegraphmodel 8 | adder(l3dprimitive.newsphere("sp",1,1,1),0,0,0,0,0,0) 9 | adder(l3dprimitive.newbox("sp",5,1.5,.5),6,0,0,0,0,0) 10 | adder(l3dprimitive.newcylinder("sp",1,1.,5),-6,0,0,20,40,0) 11 | end 12 | 13 | 14 | nodes = {} -- a list of all nodes, prevents garbage collection 15 | 16 | function scenenodeadder (l3d,x,y,z,rx,ry,rz) 17 | -- provides functionality to use the scenenode system 18 | local node = scenenode.new("node") 19 | 20 | node:localpos(x,y,z) 21 | node:localrotdeg(rx,ry,rz) 22 | node.l3d = l3d 23 | l3d:linkinterface(node) 24 | l3d:rfLitSun(true) 25 | 26 | nodes[#nodes+1] = node 27 | end 28 | 29 | function actornodeadder(l3d,x,y,z,rx,ry,rz) 30 | -- provides functionality to use the actornode system 31 | local node = actornode.new("node") 32 | 33 | node:pos(x,y,z) 34 | node:rotdeg(rx,ry,rz) 35 | node.l3d = l3d 36 | l3d:linkinterface(node) 37 | l3d:rfLitSun(true) 38 | 39 | nodes[#nodes+1] = node 40 | end 41 | 42 | -- use either one or another system to create the same scene: 43 | buildscene(actornodeadder) 44 | --buildscene(scenenodeadder) 45 | 46 | --- some scene setup for our camera / lighting 47 | cam = actornode.new("cam") 48 | l3dcamera.default():linkinterface(cam) 49 | cam:pos(10,10,35) 50 | cam:lookat(0,0,0,0,0,1) 51 | 52 | sun = actornode.new("sun",100,40,200) 53 | sun.light = l3dlight.new("sun") 54 | sun.light:makesun() 55 | sun.light:linkinterface(sun) 56 | 57 | render.drawvisspace(1) 58 | 59 | -- only for cleanup stuff used in the tutorial framework 60 | return function() render.drawvisspace(0) end -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/T015-frontbackplane.lua: -------------------------------------------------------------------------------- 1 | -- Camera clipping planes 2 | 3 | view = UtilFunctions.simplerenderqueue() 4 | view.rClear:colorvalue(1.0,1.0,1,0) 5 | 6 | 7 | box = actornode.new("box",0,0,0) 8 | box.l3d = l3dprimitive.newbox("box",1.5,1.5,1.5) 9 | box.l3d:linkinterface(box) 10 | box.l3d:rfLitSun(true) 11 | box.l3d:color(1,0,0,1) 12 | 13 | box2 = actornode.new("box",0,0,0) 14 | box2.l3d = l3dprimitive.newbox("box",1.0,2.5,1.5) 15 | box2.l3d:linkinterface(box2) 16 | box2.l3d:rfLitSun(true) 17 | box2.l3d:color(1,1,0,1) 18 | 19 | --sphere = actornode.new("sphere",0,-.5,0) 20 | --sphere.l3d = l3dprimitive.newsphere("sphere",1,1,1) 21 | --sphere.l3d:linkinterface(sphere) 22 | --sphere.l3d:rfLitSun(true) 23 | 24 | 25 | 26 | --- some scene setup for our camera / lighting 27 | cam = actornode.new("cam") 28 | l3dcamera.default():linkinterface(cam) 29 | l3dcamera.default():backplane(15.5) 30 | l3dcamera.default():frontplane(14.5) 31 | cam:pos(10,10,5) 32 | cam:lookat(0,0,0,0,0,1) 33 | 34 | sun = actornode.new("sun",100,40,200) 35 | sun.light = l3dlight.new("sun") 36 | sun.light:makesun() 37 | sun.light:linkinterface(sun) -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/T028/q3test_index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Quake III Level test 4 | 5 | 6 | The level was converted with the luxf3d tool and is loaded as l3dlevelmodel, 7 | which generates an octree from it and applies the lightmaps.
8 |
Authors of the level (textures were removed):
9 | Alcatraz (http://www.planetquake.com/bighouse),
10 | Nunuk ( http://www.planetquake.com/nunuk),
11 | Sock (http://www.planetquake.com/simland)
12 | 13 |
14 |
15 | Use W+A+S+D+SPACE+C and your mouse to fly around, SHIFT accelerates.

16 | You can hide this by pressing ENTER
17 | 18 | -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/T030-localnormalmap.lua: -------------------------------------------------------------------------------- 1 | -- TODO Localspace Normal Mapping 2 | 3 | if (true) then 4 | return NOTREADY() 5 | end 6 | 7 | -- 8 | -- models/mirroredlocalmap.f3d 9 | -- shaders/normalmap_local.shd 10 | -- gpuprogs/localnormalmap.cg 11 | 12 | 13 | ------------------- 14 | -- basic scene 15 | view = UtilFunctions.simplerenderqueue() 16 | view.rClear:colorvalue(0.0,0.0,0.0,0) 17 | 18 | model.loaderprescale(0.05,0.05,0.051) 19 | local mdlname = "mirroredlocalmap.f3d" 20 | 21 | actor = actornode.new(mdlname,0,0,0) 22 | local mdl = model.load(mdlname,false,true,true) 23 | actor.l3d = l3dmodel.new(mdlname,mdl) 24 | actor.l3d:linkinterface(actor) 25 | 26 | sun = actornode.new("sun",-3,10,10) 27 | sun.light = l3dlight.new("sun") 28 | sun.light:ambient(.2,.2,.2,1) 29 | sun.light:linkinterface(sun) 30 | sun.light:makesun() 31 | sun.sphere = l3dprimitive.newsphere("sun",0.03) 32 | sun.sphere:linkinterface(sun) 33 | 34 | -- because specularity is a effect that shows better in 35 | -- motion, as it depends on eye/reflect vector, we rotate 36 | -- the model 37 | 38 | -- rotation of object 39 | -- we want the object to rotate with a fixed predefined rotation 40 | local origrottm = matrix4x4.new() 41 | --origrottm:rotdeg(40,-20,40) 42 | local rotatortm = matrix4x4.new() 43 | 44 | function rotit () 45 | local t = system.time() 46 | --local rotmat 47 | rotatortm:rotrad(0,0,t*0.001) 48 | rotatortm:mul(origrottm) 49 | 50 | -- set position fix 51 | rotatortm:pos(0,15,0) 52 | 53 | actor:matrix(rotatortm) 54 | end 55 | 56 | Timer.set("tutorial",rotit,20) 57 | -- rotit is now called every 20 milliseconds 58 | 59 | 60 | ------------------------------ 61 | -- Shader / Material setup 62 | 63 | local mtl = material.load( 64 | "MATERIAL_AUTO:normalmap_local.shd|nocompress;Box01NormalsMap.tga","-DUSEMIRROR;") 65 | 66 | for i=1,mdl:meshcount() do 67 | local mid = mdl:meshid(i-1) 68 | actor.l3d:matsurface(mid,mtl) 69 | end 70 | actor.l3d:rfLitSun(true) 71 | -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/T031-2dphysics.lua: -------------------------------------------------------------------------------- 1 | -- TODO 2d physics 2 | 3 | if (true) then 4 | return NOTREADY() 5 | end 6 | -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/T032-usertextures.lua: -------------------------------------------------------------------------------- 1 | -- User textures 2 | -- shows how to create user created textures 3 | 4 | -- basic scene setup 5 | view = UtilFunctions.simplerenderqueue() 6 | view.rClear:colorvalue(1.0,1.0,1.0,1) 7 | 8 | cam = actornode.new("camera",8,5,6) 9 | l3dcamera.default():linkinterface(cam) 10 | cam:lookat(0,0,0, 0,0,1) 11 | 12 | cube = actornode.new("actor") 13 | cube.l3d = l3dprimitive.newbox("cube",2,2,2) 14 | cube.l3d:linkinterface(cube) 15 | 16 | -- create the texture now 17 | tw,th = 32,32 -- width and height values 18 | -- should be power of 2, otherwise it's becoming tricky 19 | 20 | usertex = texture.create2d("usertex",tw,th,textype.rgb(), 21 | true,false,false) -- let's create an rgb texture with, 22 | -- we are keeping the data, we don't want mipmaping nor 23 | -- texture filtering 24 | usertex:clamp(true) -- switching on clamping since texture 25 | -- is not repeating on any axis. Because of the symmetry 26 | -- of our chosen pattern, we wouldn't see much difference 27 | -- here if we used no clamping, however if other patterns 28 | -- are used, borders can become visible 29 | 30 | cube.l3d:matsurface(usertex) -- assign our texture to our cube 31 | 32 | Timer.set("tutorial", 33 | function () 34 | -- we create growing rings, thus we need a phase 35 | local phase = os.clock()*2 36 | -- loop over all pixels (yes, that is very expensive) 37 | for x=0,tw-1 do 38 | for y=0,th-1 do 39 | -- distance of the pixel to the center 40 | local dx,dy = x-tw*.5-.5,y-th*.5-.5 41 | -- distance length (using again a^2+b^2 = c^2) 42 | local d = math.sqrt(dx*dx+dy*dy) 43 | -- calculate an r/g/b value, the blue value 44 | -- is now a sinus signal - we square the value 45 | -- so there won't be negative values 46 | local r,g,b = 0,0,math.sin(phase-d*.1)^2 47 | -- assign the rgb value to the pixel 48 | usertex:pixel(x,y,r,g,b,1) 49 | end 50 | end 51 | -- upload the data 52 | usertex:uploaddata() 53 | end 54 | ,20) 55 | -------------------------------------------------------------------------------- /projects/tutorials/tutscripts/T033-tangentnormalmap.lua: -------------------------------------------------------------------------------- 1 | -- TODO Tangentspace Normal Mapping 2 | 3 | if (true) then 4 | return NOTREADY() 5 | end 6 | 7 | -- 8 | -- models/senior.f3d 9 | -- materials/senior.tga.mtl 10 | -- shaders/normalmap_full.shd 11 | -- gpuprogs/tangentnormalmap.cg -------------------------------------------------------------------------------- /zbstudio-integration/interpreters/luxinia.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = "Luxinia", 3 | description = "Luxinia project", 4 | api = {"luxiniaapi","baselib"}, 5 | frun = function(self,wfilename,withdebug) 6 | if not ide.config.path.luxinia then wx.wxMessageBox("Please define 'path.luxinia' in your cfg/user.lua (see estrela.lua for examples)"); return end 7 | local projdir = ide.config.path.projectdir 8 | local args = (projdir and projdir:len()>0 9 | and " -p "..projdir or "") 10 | 11 | local fname = wfilename:GetFullName() 12 | args = args..(fname and (" -t "..fname) or "") 13 | 14 | if withdebug and ide.config.luxinia1debug then 15 | DebuggerAttachDefault({ 16 | basedir=projdir, 17 | run=true, } 18 | ) 19 | local editorDir = string.gsub(ide.editorFilename:gsub("[^/\\]+$",""),"\\","/") 20 | script = "".. 21 | "package.path=package.path..';"..editorDir.."lualibs/?/?.lua';".. 22 | "io.stdout:setvbuf('no'); mobdebug = require('mobdebug'); mobdebug.start('" .. ide.debugger.hostname.."',"..ide.debugger.portnumber..");".. 23 | "jit.debug();mobdebug.off();" 24 | 25 | args = args..' -b "'..script..'"' 26 | end 27 | 28 | local cmd = 'luxinia.exe --nologo'..args 29 | CommandLineRun(cmd,ide.config.path.luxinia,true,true) 30 | end, 31 | fuid = function(self,wfilename) return "luxinia "..(ide.config.path.projectdir or "") end, 32 | fprojdir = function(self,wfilename) 33 | local path = GetPathWithSep(wfilename) 34 | fname = wx.wxFileName(path) 35 | 36 | while ((not wx.wxFileExists(path.."main.lua")) and (fname:GetDirCount() > 0)) do 37 | fname:RemoveDir(fname:GetDirCount()-1) 38 | path = GetPathWithSep(fname) 39 | end 40 | 41 | return path:sub(0,-2) 42 | end, 43 | hasdebugger = ide.config.luxinia1debug or false, 44 | } 45 | --------------------------------------------------------------------------------