-
Posts
3,618 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by shadmar
-
Leadwerks Editor Bugged (again)
shadmar replied to Haydenmango's topic in Leadwerks Engine Bug Reports
Just a thought, delete all posteffects in play, does the problems still occur? -
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
-
Yes this whiterabbit did here is pretty much it, Rick
-
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.
-
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
-
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.
-
http://www.leadwerks.com/werkspace/files/file/471-animated-vegetation-shader/
-
attempt to call global 'require' (a nil value)?????
shadmar replied to metaldc4life's topic in Programming
you can change it from require("scripts/class") to import "scripts/class.lua" -
FirePit from LE2 - workshop doesnt accept my shaders
shadmar replied to shadmar's topic in Leadwerks Engine Bug Reports
Ok, but the issue is really the material -
Try : System:Print(self.player:GetClassName()) if not an entity, cast it to an entity self.player=tolua.cast(self.player,"Entity")
-
It's just theoretical nerd babble of the end of days with casting, if works, just cast it
-
Simple animated flag shader (prefab) with windspeed controls.
shadmar posted a topic in Game Artwork
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 -
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.
-
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).
-
+1 Oh if you need any material/shader help, im hanging around here
-
Concept Idea For My Game - LUA or C++ for Coding?
shadmar replied to Defranco's topic in General Discussion
This might help aswell : http://www.leadwerks.com/werkspace/topic/6217-c-lua-and-editor-tutorials/page__st__100#entry78106 -
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.
-
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; }
-
Can't unsubscribe to a workshop item in steam
shadmar replied to ChaoticRetro's topic in General Discussion
The editor remember the last used material when using csg, so make a box with a different material, then unsubscribe. -
mPlane and camera vectors are just positions which you have normalized, and it doesn't make any sense. What are you trying to achieve?
-
You can also mod shaders for this which just reads the extra alpha texture and pass it to the fragData0.a