-
Posts
3,946 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by macklebee
-
if thats the case, then try beveling the edges of the walls and ceiling where they meet and make both thicker. Or worse case just extend the walls into the ceiling so they overlap.
-
I assume that is made via CSG? if so, try extending the wall block into the ceiling block. Also try making the walls/ceiling thicker. In LE2 using 3dws models, I was able to resolve this for the most part by chamfering/beveling the corners and making the walls thicker. Also by tweaking the directional light settings (but those settings do not appear to be available in LE3).
-
For this I would just make a slight change to the existing shader used for DrawImage by adding a scale uniform to it since the command GraphicsDriver::TileImage is not official and is not available for lua. Also the post that TJ links to asked about clipping a drawn image. It could be done via drawing to a buffer but you could also just make another slight modification to the 'drawimage.shader' by adding another uniform to set the X&Y start of the clipped image used in conjunction with the scale uniform. Fragment portion of the 'drawimage.shader': #version 400 uniform vec4 drawcolor; uniform sampler2D texture0; uniform vec2 scale = vec2(1.0,1.0); //added for tiling uniform vec2 clipcoords = vec2(0.0,0.0); //added for clipping in vec2 vTexCoords0; out vec4 fragData0; void main(void) { fragData0 = drawcolor * texture(texture0, vTexCoords0 *scale + clipcoords); } Then to use: shader = Shader:Load("Shaders/Drawing/drawimage.shader") shader:SetVec2("scale", Vec2(#,#)) --the default is vec2(1.0,1.0) so it doesn't effect the normal drawimage command shader:SetVec2("clipcoords", Vec2(#,#)) --the default is vec2(0.0,0.0) so it doesn't effect the normal drawimage command context:DrawImage() Edit -- I changed the above shader code to make the scale a Vec2 value in case you only wished to tile the image in one direction. Edit2 - I changed the fragData0 line to multiply by scale prior to adding the clipccords.
-
I love playing around with glsl sandbox effects (just wish there was a search function). Thats a fun one you found, shadmar. It works in LE with hardly any changes.
-
The reason I suggested to just replace the 'drawprimitive.shader' is because the 'DrawRect()' command loads it inherently anyways. So you wouldn't have to set or track the context's "old" shader, but if your method works for you - good enough.
-
I'm new here, and I've some questions :D
macklebee replied to Sabino98's topic in General Discussion
@cassius - as the steam versions are the only product being sold at the moment, the OP would have to purchase the indie (lua version) to use the DLC standard (c++ version). -
Sounds to me you are wanting to draw a rectangle with a color gradient? If so, I would just use the inherent DrawRect() command and change the default shader used in the Shaders/Drawing folder to allow for a gradient. Replace the 'drawprimitive.shader' with this file: drawprimitive.zip To use: 'shader = Shader:Load("Shaders/Drawing/drawprimitive.shader")' 'context:SetColor()' to set the start color 'shader:SetVec4("endcolor", ...)' to set the end color (green is the default color) 'shader:SetInt("horizontal", 1)' to set horizontal gradient (vertical is the default) 'DrawRect()' to draw the gradient rectangle This will give you a simple gradient: Note that this will also give a gradient to the selection "box" when you select an item in the Asset Browser.
-
if you open the invisible.mat in a text file editor, you will see that it only contains one line: drawmode=0 As the property is not documented, its hard to say what all of the possible options could be. All other built-in materials have the drawmode set to -1. There are other properties as well that can be listed in the material file that have no documentation. When you create a new material, the text file will contain the property: lightingmode=1 but when you save the material via the material editor, then this line is removed from the file and two undocumented properties are added: alwaysuseshader=0 drawmode=-1
-
He is referring to the 5 default materials in the Materials/Developer folder: - doorway.mat - redgrid.mat - stairs.mat - wall.mat - window.mat If you open any of these materials, then an error is shown regarding the missing *.tex files of the same name.
-
2) in previous versions of LE, this was lessened/resolved by chamfering / beveling the corners where walls/ceilings/floors meet combined with thick walls.
-
Apply fullscreen shader after the GUI is drawn?
macklebee replied to whiterabbit's topic in Programming
Well yes that can be done by just rendering/drawing the scene/2D items to another buffer, apply the shader, and then draw the results to the default context buffer. Then to turn off/on you could set a toggle to not enable the shader in your code. Then you wouldn't have to edit shaders. It really depends on what you are comfortable with - shaders and buffer manipulation can be confusing for people just starting out. function App:Start() self.window = Window:Create() self.context = Context:Create(self.window) self.buffer = Buffer:GetCurrent() self.myworld = World:Create() self.mybuffer = Buffer:Create(self.context:GetWidth(), self.context:GetHeight(),1,1) self.myshader = Shader:Load("Shaders/PostEffects/grayscale.shader") Map:Load("Maps/start.map") self.toggle = 0 return true end function App:Loop() if self.window:Closed() or self.window:KeyHit(Key.Escape) then return false end Time:Update() self.myworld:Update() self.mybuffer:Enable() self.myworld:Render() self.context:SetBlendMode(Blend.Alpha) self.context:SetColor(1,0,0,1) self.context:DrawText("FPS: "..Time:UPS(), 0, 20) self.context:SetColor(1,1,1,1) self.context:SetBlendMode(Blend.Solid) self.buffer:Enable() if self.window:KeyHit(Key.Up) then self.toggle = 1 - self.toggle end if self.toggle==1 then self.myshader:Enable() else self.myshader:Disable() end self.mybuffer:GetColorTexture():Bind(1) self.context:DrawImage(self.mybuffer:GetColorTexture(),0,0,self.context:GetWidth(),self.context:GetHeight()) self.myshader:Disable() self.context:Sync() return true end Keep in mind this code assumes that your scene has a camera in it either as an scene entity or created via an entity script like in the fpsplayer script.- 4 replies
-
- posteffect
- shader
-
(and 1 more)
Tagged with:
-
Why doesn't pickinfo.normal return -1, 0, or 1 only?
macklebee replied to CrazyM's topic in Programming
It must be something with blender - either via a setting when exporting or the exporter itself. When I created boxes using UU3D and exported as mdl, fbx binary, and fbx ascii, I am able to get the expected response for normals when the model is aligned to a global axis. testboxes.zip -
Apply fullscreen shader after the GUI is drawn?
macklebee replied to whiterabbit's topic in Programming
The easiest way to use the 'grayscale.shader' is to just apply it to the Root of your scene via the World' Post Effects. Then just make sure the camera is setup to allow post effects either via code (if its created via code) or by selecting the 'Use Post-Effects' option in the camera properties (if its an entity in the scene browser). Either way, a post effect only effects what is rendered, whereas 2D drawing commands are applied after the rendering. Like you showed you can set the color of the 2D draw commands via 'context:SetColor()'. EDIT--If you really have your heart set on applying a grayscale to your text and images via the 2D draw commands instead of just setting the color or using grayed images, then just modify the drawtext and drawimage shaders like this: drawtext.shader's fragment main loop: void main(void) { vec4 color = drawcolor; color.a *= texture(texture0,ex_texcoords0).a; float l = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722; fragData0 = vec4(l, l, l, color.a); } drawimage.shader's fragment main loop: void main(void) { vec4 color = drawcolor * texture(texture0,vTexCoords0); float l = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722; fragData0 = vec4(l, l, l, color.a); }- 4 replies
-
- posteffect
- shader
-
(and 1 more)
Tagged with:
-
JKnife duplicated the report after I had posted - so deleted mine
-
Looking at this again, it appears the value of 'Key.MButton' is assigned as 4 like the OP alluded to -when it should be 3 System:Print("Left: "..Key.LButton) System:Print("Right: "..Key.RButton) System:Print("Middle: "..Key.MButton) returns: Left: 1 Right: 2 Middle: 4 So if I would have used the variable instead of the value of 3 then it would not have worked when clicking the middle mouse button (wheel): if self.window:MouseDown(Key.MButton) then mouse = 3 end EDIT--The value of 'Key.MButton' should be opened as a bug report.
-
And my point and others is: majority of them are exposed to lua and if we can't get official documentation then I see no reason why it hurts to have these posted. I personally would not have been able to do any of the shader effects I have done in lua without shadmar posting the c++ info about buffers here: http://www.leadwerks.com/werkspace/topic/10171-buffer-commands-exposed-to-lua-with-documentation/#entry75328 Granted all of this would be moot if the official documentation was completed.
-
Why doesn't pickinfo.normal return -1, 0, or 1 only?
macklebee replied to CrazyM's topic in Programming
I wonder if there are some inconsistencies on the faces due to smoothing or some feature being used when exported. I don't have blender to try but if I get a chance I will try it using a cube from another modeling app. -
As to what Aggror posted that is how the mouse buttons have always been since the very early days of LE. Just out of curiosity, what do you get if you run this lua script on your machine: function App:Start() self.window = Window:Create() self.context = Context:Create(self.window) self.world = World:Create() self.camera = Camera:Create() self.camera:Move(0,0,-3) local light = DirectionalLight:Create() light:SetRotation(35,35,0) self.model = Model:Box() self.model:SetColor(0.0,0.0,1.0) return true end function App:Loop() if self.window:Closed() or self.window:KeyHit(Key.Escape) then return false end Time:Update() self.world:Update() self.world:Render() mouse = nil if self.window:MouseDown(1) then mouse = 1 end if self.window:MouseDown(2) then mouse = 2 end if self.window:MouseDown(3) then mouse = 3 end self.context:SetBlendMode(Blend.Alpha) self.context:DrawText("Mouse down: "..tostring(mouse),2,2); self.context:Sync(false) return true end When I click the left, right, and middle then it reports them in the order like Aggror shows.
-
Incorrect shadows on rotated csg's
macklebee replied to Einlander's topic in Leadwerks Engine Bug Reports
read this post: http://www.leadwerks.com/werkspace/topic/10082-is-this-a-shadow-normal-behavior/page__hl__shadow -
hehe - jeebus... people that post things like that are the ones that expect the MakeGame(gametype, multiplayer option) command to exist. I think a lot of the new people are having issues with figuring out how to bring assets into LE3 - which I will point out is 100 times easier than it was in LE2. The problem is there are so many different ways to obtain assets and each workflow will have its own caveats. Maybe a handful of written tuts that show how to bring a model or animated character from several sources - ie Blender, UU3D, 3DSMAX, C4D. Granted this might require several people with these software apps to be involved to help create these tuts.
-
Not everyone has the c++ version. While its not exactly the most efficient way to have documentation - having a list of available commands that show the parameters is useful. It looks like Josh has commented the ones that were exposed to lua. Another method I have done is to perform a dump of all globals in LE's lua implementation that show at least the available lua commands for LE classes. globals.txt
-
i am sure shadmar is holding out on us , but as far as I know there isn't an inherent one.
-
yes it does: if self.window:KeyHit(Key.P) then self.context:Screenshot() end which puts an image into "C:\Users\XXXX\AppData\Local/xProjectNamex/Screenshots/screenshot1.tga" on windows. I preferred the old LE2 way where you had control over where the file was created. EDIT-- ooh ok just saw that you can specify the file path and name: if self.window:KeyHit(Key.P) then self.context:Screenshot("C:/example.tga") end excellent!
-
This: Script.player=""--entity is not the same as this: Script.player = "" the commented text after the script variables will allow you to set options/parameters in the editor as explained here at the bottom of the article: http://www.leadwerks.com/werkspace/page/tutorials/_/script/creating-your-first-object-script-r110
-
Its been brought up before in suggestions: http://www.leadwerks.com/werkspace/topic/10171-buffer-commands-exposed-to-lua-with-documentation/ In that link Shadmar was nice enough to post what is shown in the c++ headers And its been posted as missing documentation in this bug report: http://www.leadwerks.com/werkspace/topic/10339-missing-in-documentation/
- 2 replies
-
- documentation
- Lua
-
(and 1 more)
Tagged with: