Jump to content

Masterxilo

Members
  • Posts

    379
  • Joined

  • Last visited

Everything posted by Masterxilo

  1. Could this please be added? I don't think this takes long to make.
  2. Why would you call it GetEntityAverageSize?
  3. r5? Maybe 2.32 should have stayed in "beta" a little longer. But that's also just a name. Looking forward to trying this out.
  4. You shouldn't use scales that differ too much from this because you'll get problems with the shadow map depth bias error (the "missing shadow pixels").
  5. Best would be to have the choice. In C++, I can override a method but still (if I want to) call the base method.
  6. You don't have to do this yourself. If oildrum.gmf is already loaded, calling LoadModel("abstract::oildrum.gmf"); again will automatically return an instanced copy of it.
  7. Depends on how long the assets take to load. Loading stuff only when it's needed is generally the better approach.
  8. When disabling vsync things do move to fast for like 1 second because the AppSpeed has to recalculate. But except for that, objects fall at the same speed at no matter what framerate for me. Really can't say why it doesn't work for you. Make sure UpdateAppTime() and UpdateWorld() are called once and only once per loop.
  9. Hmm, it works fine for me. Do AppSpeed() and AppTime() work? Print them to the screen to ensure that they do.
  10. For anyone interested, here's a cleaned up version of that shader that works with LE: // from http://www.gamedev.net/community/forums/topic.asp?topic_id=556187&whichpage=9 // / http://www.pasteall.org/12282 (newer) uniform sampler2D texture0; //RenderedTexture; uniform sampler2D texture1; //DepthTexture; //uniform sampler2D LuminanceTexture; uniform float apptime; uniform vec2 buffersize; uniform vec2 camerarange; // Math constants const float _2PI = 2.0*3.14159265; // Effect settings const int samples = 6; // samples on each ring (3-7) ! This gets multiplied by the current ring index ! -> very expensive const int rings = 4; // ring count (2-8) const float aoCap = 1.0; const float aoMultiplier = 100.0; const float aoMultiplier2 = 1.0; const float depthTolerance = 0.0000; const float aorange = 60.0;// units in space the AO effect extends to (this gets divided by the camera camerarange.y range const float radius = 0.5; const float aoexp = 1; const float noiseMultiplier = 1.0; const vec3 treshold = vec3(0.3); const bool allowEarlyOut = true; // Globals vec2 texCoord; // Functions inline vec2 rand(in vec2 coord) //generating random noise { float noiseX = (fract(sin(apptime*0.0001+dot(coord, vec2(12.9898,78.233))) * 43758.5453)); float noiseY = (fract(sin(apptime*0.0001+dot(coord, vec2(12.9898,78.233)*2.0)) * 43758.5453)); return vec2(noiseX,noiseY) * 0.004; } inline float readDepth(in vec2 coord) { float depth = texture2D(texture1, coord ).x; return (2.0 * camerarange.x) / (camerarange.y + camerarange.x - depth * (camerarange.y-camerarange.x)); } inline float compareDepths( in float depth1, in float depth2 ) { float diff = sqrt(clamp(1.0-(depth1-depth2) / (aorange/(camerarange.y-camerarange.x)),0.0,1.0)); float ao = min(aoCap, max(0.0,depth1-depth2-depthTolerance) * aoMultiplier) * diff; return ao; } void main(void) { // Calculate texCoord of current pixel texCoord = gl_FragCoord.xy/buffersize; // Get color and calculate luminance vec3 color = texture2D(texture0,texCoord).rgb; vec3 luminance = color; luminance = clamp(max(vec3(0.0),luminance-treshold) * vec3(3.0), vec3(0.0), vec3(1.0)); // high pass, original code // Early out if the luminance is nearly white if (allowEarlyOut && any(greaterThanEqual(luminance, vec3(0.7)))){gl_FragColor = vec4(color,1.0); return;} // Calculate ao float depth = readDepth(texCoord); if (allowEarlyOut && depth >= 1.0){gl_FragColor = vec4(color,1.0); return;} float aspect = buffersize.x/buffersize.y; vec2 noise = rand(texCoord); vec2 pixelSize = (vec2(1.0) / buffersize)/ vec2(clamp(depth,0.05,1.0))+(noise*(vec2(1.0)-noise)) * vec2(noiseMultiplier); float ao = 0.0, // Total ao s = 0.0; // Steps float fade = 1.0; for (int i = 0 ; i < rings; ++i) { float _step = _2PI / (samples*i); fade *= 0.5; for (int j = 0 ; j < samples*i; ++j) { float pw = (cos(j * _step) * i * radius); float ph = (sin(j * _step) * i * radius) * aspect; float d = readDepth( vec2(texCoord.s + pw * pixelSize.x, texCoord.t + ph * pixelSize.y)); ao += compareDepths(depth, d)*fade; s += 1.0*fade; } } ao /= s; ao *= aoMultiplier2; ao = 1.0-ao; ao = clamp(ao, 0.0, 1.0); ao = pow(ao,aoexp); gl_FragColor = vec4(color * mix(vec3(ao), vec3(1.0), vec3(luminance)), 1.0); return; } Doesn't look too bad:
  11. This happens because their models are intended to be used with real alpha blending where semi-transparency is possible. You have to change the alphatest shaders to allow lower alpha values to be rendered or change the alpha maps (increase contrast/brightness).
  12. hehe There are lots of definitions: http://en.wikipedia.org/wiki/Matrix
  13. Masterxilo

    C# SVN

    Yeah, but this makes pirating the engine even easier, everything people need is an engine.dll, and that is included in any le game. On the old forum, we were told to NEVER post any engine headers. On the forum here it's ok, since only registered people can access the programming section. But everyone can go to the showcase forum, download any game (or even just the evaluation), then go to that google code page, download the wrapper and he'll be ready for programming le without paying for it...
  14. You don't have to use AppSpeed() for controller movement as the controller is just a special physics body and the movement is achieved with forces. Use AppSpeed() as the parameter to UpdateWorld and make sure you call UpdateAppTime() every frame.
  15. Masterxilo

    C# SVN

    I'm quite sure that you shouldn't put the headers on a publicly available SVN. Only licensees should have access to the headers.
  16. +, getter-methods are always good. There are many of those small functions that should just be there.
  17. 2 years and 10 days after release is not what I'd call early. Many proprietary engines designed specifically for a game are finished together with the game after two years. However, I see LE is not quite comparable to this.
  18. I don't think the terrain physics body/mesh is convex xD
  19. Make sure you use these settings when importing: http://leadwerks.com/werkspace/index.php?/topic/1799-changing-terrain-size/page__view__findpost__p__16410 But to make the whole terrain higher, can't you just modify the terrain height scale/max height within editor?
  20. It should be called after in order to make it have an effect.
  21. Did you set up: Collisions(TERRAIN_COL,TERRAIN_COL); ?
  22. Hi Ammo! Please don't bump that old (6 months xD) threads but rather make a new thread and include a reference there. Though I see you couldn't make a feature request since you don't own the engine. Remapping the keyboard shortcuts has been a feature request since any were defined (since the first leadwerks sandbox). This might come eventually (wouldn't know that it's possible right now, is it?). But I think you'll find an application somewhere on the internet that does exactly what you want (map key X to Y...). (Or can windows do this? I think it can only with the mouse buttons.)
  23. Any text string can be a "key" for Set/GetEntityKey. There are just special keys which already have a reaction coded in the base class script. See 'class.lua'.
×
×
  • Create New...