Jump to content

shadmar

Members
  • Posts

    3,618
  • Joined

  • Last visited

Everything posted by shadmar

  1. You could also use a texture atlas, maybe controlled by ex_color.a or something. (Rick had such a shader in 3,0) But scripted materials sounds very flexible, me like.
  2. @Hayden, I think if you set the emitters AABB big enough, it won't stop (as a workaround).
  3. Had a quick test and this works, my box jumps up and down when player does. Attach this to a box and drag and drop player to the script variable Script.playerentity= ""--entity function Script:Start() end function Script:UpdateWorld() local y = self.playerentity:GetPosition().y local pos = self.entity:GetPosition() pos.y = y self.entity:SetPosition(pos) end
  4. Death effect using DOF dof->SetFarStart(std::max(dof->GetFarStart() - 0.75, 0.0)); dof->SetFarDist(std::max(dof->GetFarDist() - 0.75, 0.0)); dof->SetVinetteInnerBorder(std::max(dof->GetVinetteInnerBorder()-0.01,-1.0)); dof->SetVinetteOuterBorder(std::max(dof->GetVinetteOuterBorder()-0.01,0.0)); Image
  5. Set Cast Shadows to none in the editor under the apperance tab. or Lua: self.entity:SetShadowMode(0) CPP entity->SetShadowMode(0);
  6. Ok added 2 classes to the git repository along with shaders. Let me know if it works out or not or I'm going about the wrong way. https://github.com/Aggror/LeadwerksRenderFramework
  7. Thanks so this would be a nice way to do it then : class Bloom { private: float m_luminance; float m_middlegray; float m_whitecutoff; std::string m_shader; Camera* m_camera; public: Bloom(); Bloom(Camera* camera); Bloom(Camera* camera, bool active); Bloom(Camera* camera, bool active, std::string shader); ~Bloom(){}; void Activate(); void SetParams(const float lum, const float midgray, const float cutoff); void SetLuminance(const float lum); void SetMiddlegray(const float midgray); void SetCutOff(const float cutoff); const float GetLuminance() { return m_luminance; } const float GetMiddlegray() { return m_middlegray; } const float GetCutOff() { return m_whitecutoff; } const std::string default_shader = "Shadmar_Shaders/08_PP_Bloom.lua"; }; In my app I then do Bloom* mybloom = new Bloom(camera, false); mybloom->SetParams(0.06, 0.5, 0.9); mybloom->Activate(); mybloom->SetLuminance(0.1); Runtime : mybloom->SetLuminance(mybloom->GetLuminance() - 0.001);
  8. I'm trying to make a little effect class which I can easily add lua shaders in c++ This is what I got so far (this is not for framework or anything like that) #define BLOOMSHADER "Shadmar_Shaders/08_PP_Bloom.lua" using namespace Leadwerks; class Bloom { private: float m_luminance; float m_middlegray; float m_whitecutoff; std::string m_shader; Camera* m_camera; public: Bloom(); Bloom(Camera* camera); Bloom(Camera* camera, std::string shader); ~Bloom(){}; void SetParams(float lum, float midgray, float cutoff); const std::string default_shader = BLOOMSHADER; }; In my app I can then do : Camera* camera = Camera::Create(); Bloom BloomEffect(camera); BloomEffect.SetParams(0.06, 0.5, 0.9); SetParams() also works runtime for adjusting the stuff on the fly. This works and all, but then I got 6 more shaders where the class would look almost the same. Shadername would change and parameters for it. Any tip? or I just make copies of my class and change names and parameters for each shader?
  9. Doing stuff for general pupose is often much harder than injection a custom solution, so if you need help in the fx section, just ask.
  10. Right click on Leadwerks in the list of games on Steam, go to Properties, then go to "Betas". Then you will have the latest all the time.
  11. Initializing OpenGL4 graphics driver... OpenGL version 210 GLSL version 0 Says Leadwerks tries to initilialize opengl4 graphics driver, but gets a opengl 2.1 driver in return (from what I understand)
  12. Do you have the proprietary drivers installed?
  13. 4.8 GB all 58 texture packs converted to leadwerks materials (and .tga files removed)
  14. I thought of worlds as rendertargets, if you want to do refraction. If you only use one world : Render world without refracted mesh Pass buffer to refract shader Render world again with everything. <-- wouldn't this be a bit overkill, if you could render this alone using 2 worlds instead of most of it again? I really like the current lua effects system and certainly don't want to branch the renderer i any form. So if you think this would be a waste of time, then I'm in no hurry
  15. Ok I suggest we use a github repo, has free issue tracker, and wiki, storage is also free for open source projects. If anyone needs a quick intro/tutorial in using github and git (command line) I can do that.
  16. I think Rick should be in bold and one font size bigger.
  17. Haven't tested but should work with any class member or method. I probably dont understand, one of the cpp gurus should probably chip in, I should stick to gpu stuff
  18. Can't you just cast it Object* ThreadFunction(Object* object) { for (int i = 0; i<1000; i++) { //Lock the mutex so the two threads don't interfere with each other mutex->Lock(); static_cast<Model*>(object)->Turn(0.1, 0.1, 0.1); mutex->Unlock(); Time::Delay(10); } //Create something to give back to the main thread return 0; } //Create something to give back to the main thread return 0; } Then in App::Start() do something like : Model* m = Box::Create(); Thread* thread = Thread::Create(ThreadFunction,static_cast<Object*>(m));
  19. Here is my superquick test, turning a box on a second thread : (not sure if this is what you wanted) #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 Mutex* mutex = NULL; Model* m = NULL; Object* ThreadFunction(Object* object) { for (int i = 0; i<1000; i++) { //Lock the mutex so the two threads don't interfere with each other mutex->Lock(); m->Turn(0.1, 0.1, 0.1); mutex->Unlock(); Time::Delay(10); } //Create something to give back to the main thread return 0; } bool App::Start() { //Initialize Steamworks (optional) /*if (!Steamworks::Initialize()) { System::Print("Error: Failed to initialize Steam."); return false; }*/ //Create a window window = Leadwerks::Window::Create("cpp_worlds"); //Create a context context = Context::Create(window); mutex = Mutex::Create(); //Create a world world = World::Create(); camera = Camera::Create(); camera->Move(0, 2, -5); //Load the map std::string mapname = System::GetProperty("map", "Maps/start.map"); Map::Load(mapname); m = Model::Box(); m->Move(0, 3, 0); Thread* thread = Thread::Create(ThreadFunction); return true; } bool App::Loop() { //Close the window to end the program if (window->Closed()) return false; //Press escape to end freelook mode if (window->KeyHit(Key::Escape)) { if (!freelookmode) return false; freelookmode = false; window->ShowMouse(); } Leadwerks::Time::Update(); world->Update(); world->Render(); context->Sync(false); return true; }
  20. @Josh, What would be the preferred way to do this in C++?
  21. Try to add something like this : fortex->SetFilter(Texture::Smooth); fortex->SetAnisotropy(16); foreground->SetColorTexture(fortex); and maybe camera->SetMultisampleMode(2);
  22. Some effects needs to be in certain order to look correct, are we going to let the user decide which order is correct or should we default render them in correct order? (it would look strange if you don't get it the correc wayt)
×
×
  • Create New...