Jump to content

shadmar

Members
  • Posts

    3,618
  • Joined

  • Last visited

Everything posted by shadmar

  1. Just a thought, delete all posteffects in play, does the problems still occur?
  2. You can attach this to your directional light as a script to get the correct calculations : function Script:Start() self.world=World:GetCurrent() if self.camera==nil then for i=0,self.world:CountEntities()-1 do if self.world:GetEntity(i):GetClass()==Object.CameraClass then self.camera=self.world:GetEntity(i) tolua.cast(self.camera,"Camera") System:Print(self.world:GetEntity(i):GetClassName()) break end end end if self.camera then local light=self.entity self.dir = Vec3(light.mat.k.x,light.mat.k.y,light.mat.k.z):Normalize() --sun raw position is then: self.sunrawpos=Vec3(-self.dir.x,-self.dir.y,-self.dir.z) self.camera:SetKeyValue("godray_pos",self.sunrawpos:ToString()) end end
  3. Yes this whiterabbit did here is pretty much it, Rick
  4. Skybox is kinda of outdated as a postprocess since Josh now has this buildt in the root tab. But you just add it as a regular postprocess effect. 00_skybox... in the effects tab under root.
  5. No need to mod the FPScontroller script. Add a pivot to your scene and attach a simple controlscript like this in Script:Start() to locate any camera (also the one created in the FPSPlayer) local world=World:GetCurrent() for i=0,world:CountEntities()-1 do if world:GetEntity(i):GetClass()==Object.CameraClass then self.camera=world:GetEntity(i) tolua.cast(self.camera,"Camera") break end end if self.camera then self.camera:SetKeyValue.... ... end
  6. I would increase alpha using a noisemap from 0 to 1 and discard. Not as slick as diablo but would look better than just a clean vanish.
  7. http://www.leadwerks.com/werkspace/files/file/471-animated-vegetation-shader/
  8. you can change it from require("scripts/class") to import "scripts/class.lua"
  9. shadmar

    Simple LOD

    Try : System:Print(self.player:GetClassName()) if not an entity, cast it to an entity self.player=tolua.cast(self.player,"Entity")
  10. It's just theoretical nerd babble of the end of days with casting, if works, just cast it
  11. Flag shader with some controls : Install: unzip into project root Drag Prefabs/Flag/LEFlag into scene Adjustables: In scene/script tab Wind Frequency Wobble SpeedFactor You can easily swap out the flag model with something more exciting than mine. Pics shows when wind is 0.5 and 1.0 flag.zip
  12. You can do that yourself, only the sunvector is sent from daynight, just set the sun's normalized directional vector, like this anywhere you like, cpp/lua: self.camera:SetKeyValue("godray_pos",Vec3(-x,-y,-z):ToString()) camera->SetKeyValue("godray_pos", std::string(Vec3(-x, -y, -z))); But my bloom is already 3 times faster than the one that comes with LE. Not sure what else there would be to do.
  13. Wierd should work out of the box. If you in Leadwerks Project Manager create a c++ project you should be able to open the project c:/user/Documents/Leadwerks/Projects/YourProject/Projects/Windows/yourProject.sln in VS2013 and compile it.
  14. You need VS2013 express for desktop : http://www.microsoft.com/en-us/download/details.aspx?id=40787 It's free
  15. Hey Cassius, I think you can trade your standalone version for a steam key if you PM Josh, this way you get all the updates immediately. There is really no drawbacks on the steam version, since you can run it just fine in offline mode (no internet).
  16. +1 Oh if you need any material/shader help, im hanging around here
  17. This might help aswell : http://www.leadwerks.com/werkspace/topic/6217-c-lua-and-editor-tutorials/page__st__100#entry78106
  18. Or have a cpp user just build you a executable with a password of your choosing if you are publishing or want to test. Ofcource they would have to know the password.
  19. If you have the c++ version, you can easily build a basic protection for lua based games. Here is a quick example, compress all your assets folders with a password and rename them as .dat files. In main.cpp Find this and change into something like this std::string file = dir->files[i]; if (Leadwerks::String::Lower(Leadwerks::FileSystem::ExtractExt(file))=="dat") { Leadwerks::Package::Load(file,"password"); } Here is a App.cpp for lua execution of App.lua #include "App.h" using namespace Leadwerks; App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {} App::~App() { delete world; delete window; } Vec3 camerarotation; #if defined (PLATFORM_WINDOWS) || defined (PLATFORM_MACOS) bool freelookmode = true; #else bool freelookmode = false; #endif bool App::Start() { int stacksize = Interpreter::GetStackSize(); //Get the global error handler function int errorfunctionindex = 0; #ifdef DEBUG Interpreter::GetGlobal("LuaErrorHandler"); errorfunctionindex = Interpreter::GetStackSize(); #endif //Create new table and assign it to the global variable "App" Interpreter::NewTable(); Interpreter::SetGlobal("App"); //Invoke the start script if (!Interpreter::ExecuteFile("Scripts/App.lua")) { System::Print("Error: Failed to execute script \"Scripts/App.lua\"."); return false; } //Call the App:Start() function Interpreter::GetGlobal("App"); if (Interpreter::IsTable()) { Interpreter::PushString("Start"); Interpreter::GetTable(); if (Interpreter::IsFunction()) { Interpreter::PushValue(-2);//Push the app table onto the stack as "self" #ifdef DEBUG errorfunctionindex = -(Interpreter::GetStackSize() - errorfunctionindex + 1); #endif if (!Interpreter::Invoke(1, 1, errorfunctionindex)) return false; if (Interpreter::IsBool()) { if (!Interpreter::ToBool()) return false; } else { return false; } } } //Restore the stack size Interpreter::SetStackSize(stacksize); return true; } bool App::Loop() { //Get the stack size int stacksize = Interpreter::GetStackSize(); //Get the global error handler function int errorfunctionindex = 0; #ifdef DEBUG Interpreter::GetGlobal("LuaErrorHandler"); errorfunctionindex = Interpreter::GetStackSize(); #endif //Call the App:Start() function Interpreter::GetGlobal("App"); if (Interpreter::IsTable()) { Interpreter::PushString("Loop"); Interpreter::GetTable(); if (Interpreter::IsFunction()) { Interpreter::PushValue(-2);//Push the app table onto the stack as "self" #ifdef DEBUG errorfunctionindex = -(Interpreter::GetStackSize() - errorfunctionindex + 1); #endif if (!Interpreter::Invoke(1, 1, errorfunctionindex)) { System::Print("Error: Script function App:Loop() was not successfully invoked."); Interpreter::SetStackSize(stacksize); return false; } if (Interpreter::IsBool()) { if (!Interpreter::ToBool()) { Interpreter::SetStackSize(stacksize); return false; } } else { Interpreter::SetStackSize(stacksize); return false; } } else { System::Print("Error: App:Loop() function not found."); Interpreter::SetStackSize(stacksize); return false; } } else { System::Print("Error: App table not found."); Interpreter::SetStackSize(stacksize); return false; } //Restore the stack size Interpreter::SetStackSize(stacksize); return true; }
  20. The editor remember the last used material when using csg, so make a box with a different material, then unsubscribe.
  21. mPlane and camera vectors are just positions which you have normalized, and it doesn't make any sense. What are you trying to achieve?
  22. You can also mod shaders for this which just reads the extra alpha texture and pass it to the fragData0.a
×
×
  • Create New...