-
Posts
3,618 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by shadmar
-
Yes, this was superquick mockup, I didn't use many calories on testing, like transparency. There probably room for extensive improvments. The depthbuffer is good idea I think.
-
I think it should be very easy to use. Oneliners are easy to use, if we need multiple lines per effect, it's more trouble than it's worth. I mean if it's open source, you can just adapt it yourself for a custom shader?
-
No, they could be anywhere.
-
Nice, that why I would need you guys.!
-
We might also throw in a waterplane wich does reflections aswell, but it would require clipping shaders on everything else, but maybe for later. I think we should overload everything so we can adjust them as wanted something like; fw->SetBloom(); fw->SetBloom(Shader* shader, float low, float middle, float cutoff, float strength);
-
Here is an example which renders skybox as background and the rest as foreground using 2 worlds http://www.leadwerks.com/werkspace/topic/9464-rendering-backgroundsforegrounds/#entry72636
-
Stuff like refraction and reflection are very heavy to render using just one world since you basicly re-render the same stuff twice only hide the refracted or reflected stuff. Using worlds I think would make this alot faster. (haven't really tested) that much. However I can supply shaders to go with the framework, but I'm not all that senior CPP, I'd like someone else to set up the base class(es). Github or a bitbucket project on this could be nice and people can just work / submit stuff / patch stuff when they have time or it's needed. This can be done in lua probably aswell. But I just wanted some opinions.
-
We could make one ourselves, which supported some of the features like in 2.5. http://www.leadwerks.com/wiki/index.php?title=Framework Would this be a bad idea? or why not? Just simple and lightweight.
-
Look at http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/world/ You can render each world seperately using it's own camera.
-
Already "ordered" weeks ago
-
Beta branch update: Tons of art pipeline enhancements
shadmar commented on Josh's blog entry in Development Blog
Great update, post effects are working in the editor aswell, some minor stuff still, but I should have a load of new stuff up very soon. -
Yes I subscribe to his releases, these are really great. We should have all these on the workshop (with nobiaxs' permission first), I think most of them are CC-BY-CA.
-
I think shader::Load has a bug when loading from workshop. I can fetch textures and materials, but not shaders. This should work, but it doesn't self.shader = Shader:Load("PP_klepto_skybox.shader",0,256268930) Gives me the entire project path in the error: Error: Failed to load shader "C:/Users/shad/Documents/Leadwerks/Projects/post/PP_klepto_skybox.shader" However it works for textures and mats: self.texture = Texture:Load("SkyLE25.tex",0,256268930) self.mats= Material:Load("Water.mat",0,256268930)
-
Here is an working example for rendering skybox as background world : #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 World* backworld = NULL; Camera* skycam = NULL; Model* skybox = NULL; Buffer* foreground = NULL; Buffer* background = NULL; Texture* backtex = NULL; Texture* fortex = NULL; 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); //Create a world world = World::Create(); backworld = World::Create(); //create buffer for background background = Buffer::Create(context->GetWidth(), context->GetHeight(), 1, 0, 0); backtex = Texture::Create(context->GetWidth(), context->GetHeight(), Texture::RGBA, 0, 1, 0); //create buffer for foreground foreground = Buffer::Create(context->GetWidth(), context->GetHeight(), 1, 1, 0); fortex = Texture::Create(context->GetWidth(), context->GetHeight(), Texture::RGBA, 0, 1, 0); //create skybox camera in background World::SetCurrent(backworld); skycam = Camera::Create(); //create a flipped box and paint it with sky material skybox = Model::Box(); skybox->FlipNormals(); skybox->SetMaterial(Material::Load("Materials/Sky/skybox_texture.mat")); //create camera for the forground World::SetCurrent(world); camera = Camera::Create(); camera->Move(0, 2, -5); //Hide the mouse cursor window->HideMouse(); //Load the map std::string mapname = System::GetProperty("map","Maps/start.map"); Map::Load(mapname); //Move the mouse to the center of the screen window->SetMousePosition(context->GetWidth()/2,context->GetHeight()/2); 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(); } if (freelookmode) { //Keyboard movement float strafe = (window->KeyDown(Key:) - window->KeyDown(Key::A))*Leadwerks::Time::GetSpeed() * 0.05; float move = (window->KeyDown(Key::W) - window->KeyDown(Key::S))*Leadwerks::Time::GetSpeed() * 0.05; camera->Move(strafe,0,move); //Get the mouse movement float sx = context->GetWidth()/2; float sy = context->GetHeight()/2; Vec3 mouseposition = window->GetMousePosition(); float dx = mouseposition.x - sx; float dy = mouseposition.y - sy; //Adjust and set the camera rotation camerarotation.x += dy / 10.0; camerarotation.y += dx / 10.0; camera->SetRotation(camerarotation); //Move the mouse to the center of the screen window->SetMousePosition(sx,sy); } Leadwerks::Time::Update(); //Parent skybox camera to the main camera skycam->SetRotation(camera->GetRotation()); //Render background background->Enable(); backworld->Update(); backworld->Render(); background->Disable(); //Render foreground foreground->Enable(); world->Update(); world->Render(); foreground->Disable(); //Draw both worlds. context->Enable(); context->SetBlendMode(Blend::Alpha); context->DrawImage(background->GetColorTexture(), 0, 0); context->DrawImage(foreground->GetColorTexture(), 0, 0); context->SetBlendMode(Blend::Solid); context->Sync(false); return true; }
-
I'm "upgrading" the old water prefab to use these instead, this example was just my excercise to load workshop items. But uf you just use the concrete material in my example above on a simple CSG brush, it will look like very very very shallow water on conrete for example.
-
What is the difference between Leadwerks 3.0 and 3.1?
shadmar replied to karmacomposer's topic in General Discussion
Support for linux and opengl 4.0 high level renderer, realtime shadows, postprocessing, Steam workshop and more. -
Josh's animated waternormals : http://steamcommunity.com/sharedfiles/filedetails/?id=239702606 Script.Material = ""--path function Script:Start() self.textures = { } -- Fetch workshop animated water normals for x=0,9,1 do local name = "water1_0"..x..".tex" self.textures[x] = Texture:Load(name,0,239702606) end for x=10,63,1 do local name = "water1_"..x..".tex" self.textures[x] = Texture:Load(name,0,239702606) end -- Load material self.mat = Material:Load(self.Material) self.entity:SetMaterial(self.mat) self.index=0 end function Script:UpdateWorld() -- Animate normals for texture1 for material if self.index > 63 then self.index=0 end local count = 0 self.index=self.index+Time:GetSpeed()*0.5 count=math.floor(self.index) self.mat:SetTexture(self.textures[count],1) end
-
Abit late now perhaps, but this would work to use methods on the instanced one. local model2 = model:Instance() model2 = tolua.cast(model2,"Model") local surf2 = model2:GetSurface(0)
-
Lightmaps back ,Global illumination,Image based shaders ?
shadmar replied to YouGroove's topic in Suggestion Box
Normalmaps would look odd I'd guess, there no lightdirection information. -
Lightmaps back ,Global illumination,Image based shaders ?
shadmar replied to YouGroove's topic in Suggestion Box
That one works just fine. No lights in the scene. They also respond to deferrred lighting if you turn a flashlight or something on. -
Lightmaps back ,Global illumination,Image based shaders ?
shadmar replied to YouGroove's topic in Suggestion Box
UV channel 2 is empty. Usually lightmaps goes into second uv channel or will be just plain bake which will make your textures not reusable/tileable. b3d exporter seems to support lightmaps via 2nd UV channel. -
# pointlights rendered would be my guess.
-
Is this by design by any chance?
-
Case : I want to provide ready to go materials but also some new shaders to go with them , but I also want the user to be able to replace the textures. This is not currently possible since a workshop material isn't writeable. So my suggestion in addidtion to this would be having a clone workshop-material option (so you can change textures).
-
If you have some high quality textures with proper normalmaps and displacement, and a similar cubemap used in the pictures above and some material examples, I can probably have a look at some of those.