-
Posts
7,936 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Rick
-
how do i go about getting leradwerks 2.0 instead of 3.2??
Rick replied to metaldc4life's topic in General Discussion
No. C++ is harder. I offer 1 on 1 training classes for Lua if you want a more personal learning environment. It's $10/hr. Feel free to send me a PM if you want to know more. -
I would think if they implemented rand() they would have some way to seed it based on time or something, but maybe that's not what we want. I think the rand() way seems way easier but I'm not sure of how to get the color from SetColor() and if I need to include anything for rand(). Those results are using custom made rand() functions and not the GLSL one it seems.
-
Hmm, wouldn't a rand() function run for each pixel meaning during the time I'm reducing the alpha from 1-0 the same pixel could be discarded and then not discarded, then discarded, etc, over time instead of the constant a noise map would provide? Not sure how that would look vs a constant noise map.
-
OK so a noise image would look like: Then my model would supply the alpha value for the shader that has this image in some open texture slot. So on the pixel shader it does a texture lookup on the above image and? I'm lost now. What is a noise value? The shades of gray in the noise texture? So like a solid black value is a 1 and a white value is 0 (or reversed if you like), and everything in between has a value between 0 and 1 which relates to the alpha value we send in? Meaning eventually over time when the alpha value is 0 it'll eventually discard all pixels. So in shaders how could we get the color value of the noise texture and relate that to a number between 0-1 (or would it be 0-255)? I think I', understanding the idea now just not sure on how to relate the color value of the noise map to a value the alpha can be compared to.
-
Can't see the entire thing but maybe it's collapsed at the bottom or right and you have to put mouse over it and drag it over? I think that happened sometimes in Windows back in the day.
-
No watches but you can inspect variables with the Debug tab of the script editor.
-
I don't know what that means That sort of implies that it can't do this requirement though because the requirement is to have dynamic lighting and still allow fading. Having this is sort of a feature in these kinds of games. They all have this and it looks really cool. If shadmar can explain what he means maybe that's an option otherwise snapping in and out will have to do for now. It's not stopping me from continuing on, but if this ever gets far a long I know I'll have to field questions from people asking why it doesn't fade in/out.
-
Currently I'm more thinking about the walls than bodies. Just gave bodies as another example. I'm fine with a puff of particles with those, but something like a wall is different. Currently they snap show/hide which works but I guess I have no other options with a deferred renderer? That kind of sucks.
-
How are games fading models in/out? But that would be for every model that has it right? For glass sure that would work, but for walls like in my example where only certain wall models need to fade in/out at certain times that wouldn't work right. Fading models in/out has to be a pretty common need for various things. Dead bodies that you don't want to clutter up the world with, walls, chests, whatever right. Here is a video of walls fading in which is what I'm trying to do: Can we fade (not just discard) with a shader that has this controlled with the alpha value of SetColor() since the Vec4 of SetColor() is model specific?
-
When I switch from Solid to Alpha the lighting is completely different as if it's getting no lighting info at all.
-
You can do this with a shader. Check out this flag one and play with the settings to see if you can get it to work. http://www.leadwerks.com/werkspace/topic/10674-simple-animated-flag-shader-prefab-with-windspeed-controls/#entry78385
-
Was there a way to do model (or csg with a script attached so it doesn't collapse) specific transparency instead of material specific? There are certain instances where I want to fade in/out some models but they'll have the same material as other models that I always want to have shown (ie I don't want transparency of 1 model to affect another with the same material on it). I tried SetColor(Vec4(1, 1, 1, 0)) (alpha set to 0) but that didn't work.
-
Was going over all the game projects I have looking for some code and found this bad boy https://db.tt/gHJYxLLo
-
No script & I'm not doing any calculations at all.
-
I always thought the invisible mat (maybe in LE 2) had a shader assigned to it that discarded everything, but with this drawmode setting perhaps the engine itself sees this setting on a surface and simply doesn't pass that surface along to be rendered?
-
There doesn't seem to be an invisible shader though. Just material with no shader assign to it so I assume the engine itself is doing something with the mat. I thought there used to be an invisible shader that just did a discard in it, but can't recall exactly. I figured the engine would see that this surface had this material setting assigned and then wouldn't pass it to be rendered at all. So to me it looks like one thing I can do is to Hide() all blocks the camera can't see. This should only need to be done at the start (is the block surrounded or not) and each time in a small chunk when I remove/add blocks, but even when I do that there will be a fair amount of blocks that can be seen and it looks to me that rendering them isn't the bottleneck (given when they have the invisible material I get the same poor result and that doesn't render them). So it must be something about how many objects are being iterated over by the engine in the scene graph.
-
So if you have this attached to your weapon then whenever the weapon collides with some other physics the Script:Collision() function is called by the engine and passes in the entity it collided with (the first parameter). It calls the output OnEnter, but that's for the flowgraph which you probably don't have setup and really don't need it here, but it helps to point out OnCollide vs OnEnter. Under CallOutputs("OnEnter") you can get the entities script and see if it has a Hurt() function (if it's an "actor" which you have to implement or if you are already using the AI.lua script). if entity.script.Hurt ~= nil then entity.script:Hurt(10) end
-
My invisible.mat in the editor has blend mode set to solid though, and it seems to still work.
-
So I'm playing around with a bunch of cubes. 16 wide by 16 deep and between 1 and 8 height. I make them all have the invisible material and I print out the stats to the screen. When I have 1 layer height (just 16x16 cubes) I get 250 fps. The stats say 0 polygons (which I expect). When I have 8 height layers of 16x16 width/deep I get 70 fps. The stats still say 0 polygons. If no polygons are being drawn why do I get the big drop in fps? All the other information stays the same. 0 polygons 0 shadow polygons 1 lights drawn 1 shadows rendered 0 batches 0 draw calls Render time: 0 Update time: 0 So what's causing the big fps drop? [edit] I notice if I Hide() the cubes then it goes back up. So I assume the looping over all these in the octree is causing this fps hit?
-
There doesn't seem to be any shader in the invisible.mat so just wondering how it works?
-
Perfect, that's what I'm looking for. It also looks like I can use 1 shape and set it to many models, which is nice!
-
Shape* shape = Shape::Box(0,0,0, 0,0,0, 10,1,10); ground->SetShape(shape); shape->Release(); What's the proper way to remove a shape from an entity? Do I just pass in NULL? Is that good enough? I assume calling SetShape() increases the ref counter? So by releasing it afterwards the ref count is 1, and if I call SetShape(NULL) it'll reduce it to 0?
-
You are firing an output in Collision() but you aren't doing any damage. Take a look at this script which gives you an OnEnter/OnLeave collision. http://leadwerks.wikidot.com/wiki:collision-enter-exit In the OnEnter is where you would want to call some sort of :Hurt() function on the entity passed into the collision (if the entity passed in is some sort of actor).