-
Posts
24,626 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Josh
-
Multiply is the most common blend I use. It may not seem intuitive, but multiplying two colors results in a darker color...because the colors are considered to be in the range from 0 to 1. Mod2x blending is multiplying, and then multiplying the result by 2. This allows one color to darken or brighten another. Additive blending is self-explanatory. I don't really use anything else.
-
This is called "shadow acne". If you look carefully, you can probably catch it in every game that uses shadow maps, at some point, to some degree.
-
Yep. The scripting functionality is built into the model class, so it doesn't matter if it's being used in the editor, a BlitzMax program, a Lua program, or a C++ program. The same routine is called every time. The only tricky difference between the editor and a C++ program is the framework object, but that has been covered in the Lua tutorial. The whole "framework" thing has been kind of a mess. It works the way it is now, and I am not going to change it, but that's one little detail I feel like the design of could have been better.
-
Hide the light, don't set the color to pure black. A black light will still have to be rendered, even if its effect is invisible. You also don't have to use messages at all, since its all a single Lua state. It can be overwhelming to try to imagine all the possibilities these kind of systems might have, but it's not hard to implement simple relationships. This is exactly the kind of thing I wanted to see users start doing with script.
-
I'd like to see a newer version if possible. I'm not sure if the demo is just old or not working right, because I ran it on an ATI 3870.
-
I think it's easier to use separate files for each animation sequence, but this is useful if they are merged into one. You can get a significant savings in speed by only animating entities in the object:Render() function. That way if they aren't rendered, they won't be animated.
-
There's now a section at the end on how to do refraction effects in the editor. It's pretty simple: http://leadwerks.com/werkspace/index.php?/page/index.html?record=10
-
There's an example at the end of this lesson of how to make a refraction effect in the editor: http://leadwerks.com/werkspace/index.php?/page/resources?record=10
-
I can't tell anything from that shot. It just looks like a lot of random colors. I updated the lesson to include information on how to use global objects to automate the material texture settings.
-
Is there a compiled example I can view?
-
Yes, you can do all of that right now. That's how the heat haze is done.
-
We'll try to organize and present this better, but for now all the content feeds are available here: http://leadwerks.com/werkspace/index.php?/page/community
-
http://leadwerks.com/werkspace/index.php?app=core&module=search&do=new_posts&search_filter_app[ccs]=1
-
If Unwrap3D doesn't support it, it doesn't exist: http://www.unwrap3d.com/u3d/formats.aspx
-
I think Tyler and Masterxilo may have posted their examples in the old forum.
-
A river class only needs to be written once, and it's fairly easy to do, based on the road class. Then you can drag and place your rivers the same way roads work.
-
I know some people are, but I can't give you any specifics.
-
So it's basically a portable media consumption device, for use only with Apple books, music, and movies? That's okay if that's what it is, but I can't afford to pay $1000 to watch movies I already have. It's still a cool idea, but just seems too expensive for what it is. I think there's a huge untapped market for a home entertainment PC. You can go to YouTube and type in almost any movie or song and see it. Why isn't there a commercial offering like this? Why can't I sit on the couch and type in a wireless keyboard the name of a song or movie I want to hear/see, and have it play? I think streaming media, and maybe even streaming games, is the surprise ultimate solution to piracy. It's easier to use than pirated materials, and it lets the publisher retain control. Sure, you could capture the incoming data, but when it's easier just to pick what you want and play it, who would bother with physical media and local files?
-
Please give this a try. For some reason, my computer thinks I already hit the 30-day limit: http://www.leadwerks.com/LEEval2.3.exe Please don't spread this around yet.
-
Yes, it will be fixed on the server.
-
Find this line in mesh.frag around line 181: if (DepthToZPosition(gl_FragCoord.z)<DepthToZPosition(texture2DProj(LE_DEPTHBUFFER,refractionvector2).x)) { Replace it with this: if (gl_FragCoord.z<texture2DProj(LE_DEPTHBUFFER,refractionvector2).x) { The variable gl_FragCoord.z is a nonlinear depth value between 0.0 and 1.0. It's stored the same way a depth value in a depth texture is stored. We could convert it to a z position with the DepthToZPosition() function, or we can just compare it directly to the depth texture read: http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=234519 I'm sure I knew this already, but I must have missed that when I wrote the shader. This will fix your problem.
-
I can produce the problem. This is very strange. This code uses the up and down keys to move the camera forwards and backwards. There is a certain spot where the error appears and disappears almost instantly. Which GPU is this occuring on? I get an error with an ATI 3870, so it is unlikely to be a driver error if you are using NVidia cards: #include "engine.h" int main(int argc, char** argv) { Initialize(); //Create a graphics context Graphics(800,600); //Create a world TWorld world=CreateWorld(); if (!world) { MessageBoxA(0,"Error","Failed to create world.",0); goto exitapp; } //Create a render buffer TBuffer gbuffer=CreateBuffer(800,600,BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL); //Lighting buffer TBuffer lightbuffer=CreateBuffer(800,600,BUFFER_COLOR); //Create a camera TEntity campiv=CreatePivot(); PositionEntity(campiv,Vec3(0,2,0)); TCamera cam=CreateCamera(campiv); PositionEntity(cam,Vec3(0,0,-1.95)); //Load the scene LoadMesh("scene.gmf"); //Create a light TLight light=CreatePointLight(); PositionEntity(light,Vec3(0,1,0)); //Create the transparency world TWorld foreground=CreateWorld(); //Create a camera for the transparency world TCamera fgcam=CreateCamera(); CameraClearMode(fgcam,0); //Create the transparent object TMesh mesh=CreateSphere(); PositionEntity(mesh,Vec3(0,2,0)); //Load the transparent material TMaterial material=LoadMaterial("glass_refraction.mat"); SetMaterialTexture(material,GetColorBuffer(lightbuffer),2); SetMaterialTexture(material,GetDepthBuffer(gbuffer),3); PaintEntity(mesh,material); TShader refractionshader=GetMaterialShader(material); SetWorld(world); TMesh cube=CreateCube(); ScaleEntity(cube,Vec3(0.1)); PositionEntity(cube,Vec3(0,2,1)); TMaterial cubematerial=CreateMaterial(); SetMaterialColor(cubematerial,Vec4(1,0,0,1)); PaintEntity(cube,cubematerial); float refractionstrength=0.01; float mx=0.0,my=0.0; TVec3 camrotation; HideMouse(); MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); //Main loop while(!KeyHit(KEY_ESCAPE)) { mx=Curve(MouseX()-GraphicsWidth()/2,mx,3); my=Curve(MouseY()-GraphicsHeight()/2,my,3); MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); camrotation=EntityRotation(campiv); camrotation.X+=my; camrotation.Y-=mx; RotateEntity(campiv,camrotation); UpdateWorld(); //Render the main world SetBuffer(gbuffer); SetWorld(world); RenderWorld(); //Render lighting SetBuffer(lightbuffer); RenderLights(gbuffer); CopyBuffer(lightbuffer,BackBuffer(),BUFFER_DEPTH|BUFFER_COLOR); CopyBuffer(gbuffer,BackBuffer(),BUFFER_DEPTH); //Set the refraction strength if (KeyDown(KEY_UP)) {MoveEntity(cam,Vec3(0,0,0.01)); }//{ refractionstrength+=0.001 ; } if (KeyDown(KEY_DOWN)) {MoveEntity(cam,Vec3(0,0,-0.01)); }//{ refractionstrength-=0.001 ; } refractionstrength=max(refractionstrength,0.0); SetShaderFloat(refractionshader,"refractionstrength",refractionstrength); //SetBuffer(gbuffer); //ClearBuffer(); SetBuffer(BackBuffer()); //Render transparency SetWorld(foreground); SetEntityMatrix(fgcam,GetEntityMatrix(cam)); RenderWorld(); SetWorld(world); Flip(); } exitapp: return Terminate(); }
-
At the moment you can't add post-processing effects unless you write the whole rendering code yourself. I am going to add a mechanism to the framework code to allow the user to easily insert effects.
-
My guess is the grass shader aligns it to the terrain which makes the billboard render incorrect.
-
Just look at the water rendering code in the framework source, or the tutorial. It's a lot of different things to set up, but if you take it one step at a time it isn't that hard.