Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Everything posted by macklebee

  1. macklebee

    white out

    simple example of fading to black and to white: window = Window:Create("fade example",0,0,800,600, Window.Center) context = Context:Create(window) world = World:Create() camera = Camera:Create() camera:Move(0,0,-3) light = DirectionalLight:Create() light:SetRotation(35,35,0) model = Model:Box() model:SetColor(0,0,1) alpha = 0.01 toggle = 0.005 color = 1 while window:KeyDown(Key.Escape)==false do if window:Closed() then break end model:Turn(0,Time:GetSpeed(),0) if alpha>=1.0 then toggle = -0.005 end if alpha<=0.0 then toggle = 0.005 color = 1 - color end alpha = alpha + toggle Time:Update() world:Update() world:Render() context:SetBlendMode(Blend.Alpha) context:SetColor(color,color,color,alpha) context:DrawRect(0,0,800,600) context:SetColor(1,0,0,1) context:DrawText(string.format("alpha: %.2f",alpha),0,2) context:DrawText("color: "..color..", "..color..", "..color,0,22) context:SetBlendMode(Blend.Solid) context:Sync(true) end
  2. No issues here for either generator (with or without the button). When you say you have tried everything does that include following the tutorial for 'Models and Animation', specifically the Collision section? http://www.leadwerks.com/werkspace/page/tutorials/_/models-and-animation-r8#section6
  3. I did not have the shadmar Substance shader installed. So when I loaded your map, one of the materials/textures that didn't load was related to those files. So I installed shadmar's files and I had no reflection on the water in game after I applied a skybox texture. Uninstalled shadmar's substance files, updated the project to re-install the official shaders, and the reflection existed in game. Are you using the MonsterAI script on the Dexsoft model? If so, I suspect that your character doesn't have the same animation naming convention as what is called out in the inherent example script (ie 'Idle', 'Run', 'Death', 'Attack1', & 'Attack2'). Look at the crawler model's animations in the Model Editor as a reference. If you are going to use other naming, then you will have to create your own custom AI script.
  4. No, you do not need that shader to have the water plane show properly. First, you need to set the water plane height to something other than 0.0 to even see it. Second, you need a skybox texture/material selected. And after that, the problem appears to be that you have another set of shaders installed that is preventing the skybox reflection on the inherent water plane. It appears shadmar's 'Substances-Metal-Roughness' is not playing friendly with the inherent water. Remove that workshop installation, update the project to re-install your original LE shaders/files, and then run the program. You should see the skybox reflecting off the waterplane. At least that works for me. Its getting to the point that people need to start including information about what other non-official shaders/files/executables they are using when posting problems. Just recently, there was someone posting a LE bug report that turned out to be a problem from the LEX template and not LE. Without knowing that someone is using 3rd party files like shaders or executables, it can lead to confusion on how to solve a problem.
  5. The DEX_Test01 map has 'water_low.shader' set as a Post Effect shader in the Scene's Map properties panel. Remove that model shader from the post effects and you will be able to view the scene when in game.
  6. Yes, it was subscribed items in that tab, but I thought the green checkmark indicated installed and the grayed icon indicated it was no longer installed?
  7. I would like to have a tab that shows what I have installed per project back. That was useful information and allowed us to install/uninstall easily.
  8. Will this addition also include brush->GetFace(index)->SetMaterial(material) and brush->CountFaces()? Counting faces would be nice but SetMaterial() would allow us to apply different materials to a brush's different faces just like in the editor.
  9. yeah it looks like we need a brush:CountFaces() and a face:GetMaterial() in addition to the brush:GetFace(i) for this to work properly. Edit: And a face:SetMaterial() to be used with the PickInfo.face
  10. Agree... i thought this was possible before. The only way I have found that I can get a brush's material is if I perform a pick on the brush or if I just perform SetMaterial() on it (which seems silly to do then perform a GetMaterial()).. Casting the Brush to Model doesn't appear to work... but if the brush doesnt have mass or script, then it will be converted to the model class and the normal GetSurface/Material will work. You can perform a pick on a brush and get the material but that's alot of work for something like this. Edit: yeah the pick only works if you just set the material via code... otherwise it doesn't work. hmmm. The entity script I was testing this with (the camera is global in my main script): function Script:Start() if self.entity:GetMaterial()==nil then System:Print("material not found") end local material = Material:Load("Materials/developer/bluegrid.mat") self.entity:SetMaterial(material) if self.entity:GetMaterial()~=nil then System:Print("material found") end end function Script:UpdateWorld() local window = Window:GetCurrent() if camera==nil then System:Print("no cam") end if window:MouseHit(1) then local pickinfo = PickInfo() local p = window:GetMousePosition() if (camera:Pick(p.x,p.y,pickinfo,0,true)) then System:Print("Class: "..pickinfo.entity:GetClassName()) if pickinfo.entity:GetClassName()=="Brush" then local bmat = pickinfo.entity:GetMaterial() if bmat~=nil then System:Print("Brush mat found") end end if pickinfo.entity:GetClassName()=="Model" then local mmat = pickinfo.surface:GetMaterial() if mmat~=nil then System:Print("Model mat found") end end end end end
  11. already reported here: http://www.leadwerks.com/werkspace/topic/12878-forum-bug/
  12. Yes, it appears to be working now. Thanks.
  13. see this post: http://www.leadwerks.com/werkspace/topic/14414-flush-mouse/#entry98680
  14. What we used to be able to do in LE2 was just flush the mouse when you reached a certain threshold to reset the mouse's Z-value. But unfortunately, 'window:FlushMouse()' does not appear to work - at least for the mouse's Z-value. This was useful for setting limits on how close or far away a third person camera could move when using the mouse's scroll for positioning.
  15. What exactly is the problem that you are having? Once I opened the box.tex with the Texture Editor and saved it as 'uncompressed' with the texture mode set to 'Cubemap', it looked pretty good when set as a skybox.
  16. http://www.leadwerks.com/werkspace/topic/10444-setmouseposition-not-setting-z-value/#entry76828
  17. self.camPivot.GetRotation() should be: self.camPivot:GetRotation() colon not period...
  18. to clamp the rotation, use the max and min on the camera's pitch value: window = Window:Create() context = Context:Create(window) world = World:Create() camera = Camera:Create() camera:Move(0,2,0) skybox = Texture:Load("Materials/Sky/skybox_texture.tex") camera:SetSkybox(skybox) light = DirectionalLight:Create() light:SetRotation(35,-35,35) ground = Model:Box(10,1,10) ground:SetPosition(0,-0.5,0) ground:SetColor(0.0,0.25,0.0) box = Model:Box() camrot = camera:GetRotation() gx=Math:Round(context:GetWidth()/2) gy=Math:Round(context:GetHeight()/2) while window:KeyDown(Key.Escape)==false do if window:Closed() then return false end local mouseposition = window:GetMousePosition() local dx = mouseposition.x - gx local dy = mouseposition.y - gy camrot.x = camrot.x + dy / 10.0 camrot.x = math.min(camrot.x,90) camrot.x = math.max(camrot.x,-90) camrot.y = camrot.y + dx / 10.0 camera:SetRotation(camrot) window:SetMousePosition(gx,gy) world:Update() world:Render() context:Sync(true) end
  19. posted a shader that allows you to set the rotation last year: http://www.leadwerks.com/werkspace/topic/13422-draw-image-mirror-options/#entry94355
  20. is this with the editor? that has multiple contexts in the editor window afaik...
  21. For debug at fullscreen, I essentially get what thirsty panther gets ~27-58 fps. For release at fullscreen, I get a solid 60 fps with vsync on and 200-300fps with vsync off throughout the scene. Considering there are ~90K+ polygons and 90K+ shadow polygons in just that little scene, it seems to do ok.
  22. or use LE's built-in method to parse a vec3 into a comma-separated string using 'Vec3:ToString()' instead of the built-in lua function 'tostring()': System:Print("Pivot Rotation: "..self.Pivot:GetRotation():ToString())
  23. The SetRange() or source issue seems to be resolved since that bug was posted. What used to happen was the source could be heard when the range was set to less than 1 meter no matter the distance between the source and the listener.
  24. Almost 11 months - it looks like the <1m range bug is fixed for the source, but the setting-position-prior-to-play bug still exists.
  25. Sounds like the bug report i posted almost a year ago: http://www.leadwerks.com/werkspace/topic/12542-source-setrange-issue/#entry90447 Along with an issue with the SetRange(), I also found at the time that you have to position the source after it is played. If you position the source then play it, then it appears to not be positioned and will play the source at full volume.
×
×
  • Create New...