Jump to content

Ma-Shell

Members
  • Posts

    371
  • Joined

  • Last visited

Everything posted by Ma-Shell

  1. @shadmar Yeah, but what actually is a surface? Just a group of vertices? If so, what separates the vertices from one surface from those in another one? Are those just user-defined groups of vertices? So why would a terrain have multiple surfaces ("surface" is defined as an array of 5 within the terrain-class, so this isn't something simply inherited)?
  2. I believe, you have to use the surface. The following doesn't yield NULL: Material* mat = terrain->surface[0]->GetMaterial(); Though I have no idea, what the index is for, maybe this can give you a push to the right direction.
  3. How can 3 (THREE) persons work on this project?
  4. What exactly is the problem? I can create a Material, activate Z-Sort and switch the Blend mode to Alpha and use the fragment shader you provided above (I also used the vertex shader from the standard diffuse shader and made it fit to the fragment shader.) With this I can get a material which is transparent.
  5. You can see, the shader uses fragData0, fragData1 and fragData2. So try adding fragData0.a = round(fragData0.a); fragData1.a = round(fragData1.a); fragData2.a = round(fragData2.a); in the end, just before the closing } @ScrotieFlapWack I don't know whether it is documented anywhere but I also only found the answer via googling, which led me to Rastar's Blog: http://www.leadwerks.com/werkspace/blog/117/entry-1167-up-part-2/ Edit: Also what you are editing is just the alpha value. The code I provided just says: If the alpha value is over 0.5 then set it to 1, else set it to 0.
  6. Well, I am not really getting why the above one doesn't work for you but you can just include a threshold in your fragment shader. Just add (after fragData0 was set): if(fragData0.a > 0.5) fragData0.a = 1; else fragData0.a = 0; You can also use a threshold other than 0.5. Edit: What would be even easier: fragData0.a = round(fragData0.a); and if the shader also set fragData1 etc. just add the lines for them as well.
  7. Make sure the texture you selected isn't set as being a cubemap, like bfn.tex or the skybox-texture. Try using the Blue/Green/Orange grids from the developer-folder and check whether it works with them. If so, your textures have some weird settings.
  8. Thanks, got it working with your bloom.lua. In case anyone else is interested: //Render first image myBuffer->Enable(); world->Render(); myBuffer->Disable(); context->Enable(); context->SetShader(myShader); myBuffer->GetColorTexture()->Bind(1); myBuffer->GetDepthTexture()->Bind(2); context->DrawImage(myBuffer->GetColorTexture(),0,0); The shader will get those by uniform sampler2D texture1; uniform sampler2D texture2; Another question regarding this: The depth-texture will only use the red-channel. The green- and blue-channel will always be 0 and the alpha-channel will always be 1. Storing four values per pixel if actually only one is useful, seems to be kind of a waste of space. Especially on the GPU space is a valuable good. Is there anything I can do to help this?
  9. Hi, is it possible to use the depthbuffer for postprocessing effects? I looked at all the existing postprocessing shaders and saw, all of them only use the color-texture, which is retrieved by uniform sampler2D texture1; I also found, that texture2 contains some kind of a cobblestone texture but all the other slots seem to be empty. Also I saw, it is possible to push a Vec4 Uniform to the shader by (C++): myShader->SetVec4("foo", Vec4(0,0, 1, 1)); (GLSL): uniform vec4 foo; but I didn't find any way of pushing an arbitrary texture as a uniform.
  10. Just rightclick on the desktop -> new -> shortcut -> enter "steam://rungameid/251810" -> give a name -> finish (the single points might be named slightly different since I translated them) EDIT: You can also just take the attached file. (The forum here doesn't allow for shortcuts (.lnk-files), so I had to zip it.) LE-shortcut.zip
  11. Hi, I noticed, when playing a sound via (C++): Sound* s = Sound::Load("Sound\\Footsteps\\jump.wav"); s->Play(); the RefCount of the Sound will be increased but not decreased after the sound is done playing. However, playing the sound via Entity* e = world->entities.front(); e->EmitSound(s); will increase the RefCount but also decrease it, after it is done playing. This should be consistent, because this has consequences: When using Play(), I can instantly after playing the sound release it with s->Release(); When using EmitSound() and doing the same, after the sound is done playing, I get into the DebugErrorHook with the message "OpenAL: AL_INVALID_OPERATION" and the game stops. I guess, this happens, because the latter method releases the sound after finishing playing it and thus the RefCount gets decreased and reaches 0, so that the sound gets deleted which is somehow a problem for OpenAL.
  12. Well, in Chrome I now have a horizontal scrollbar which can move by like 5px because of the banner .
  13. try "Time:Millisecs()" instead of "os.time()" for seeding. For your other issue we need more of your code
  14. - Exit LE-Editor - Copy mesh with only 1 vertex into model-folder of the project (see attachment) - Start LE-Editor - Switch to assets-tab - Scroll down => Access-Violation Just for justification of my sanity : Why would I want a mesh which consists only of one vertex? Answer: Geometry shader This needn't be on priority, since for clipping issues I had to take a box instead of one vertex but I guess, it can be fixed quickly. vertex.fbx
  15. The problem is that self.position is already a Vec3, so you just need to remove "Vec3" local pos = self.camera:Project(self.position) Also note, that your value of right.x will increase each frame, as in the first one it is: right.x = 1 ==> position.x + right.x = position.x + 1 right.x = position.x + 1 ==> position.x + right.x = position.x + position.x + 1 right.x = position.x + position.x + 1 ==> position.x + right.x = position.x + position.x + position.x + 1 ...
  16. To me it looks like you are referencing a variable that doesn't exist yet: The line self.right = Vec3(self.position.x + self.right.x, self.position.y, self.position.z); uses the variable self.right.x, which isn't defined yet, I guess. Try using a constant there (something like self.right = Vec3(self.position.x + 100, self.position.y, self.position.z); ) and see, if it solves the issue.
  17. Let me throw in Wings3d (free, open source): The modeler, I made my first models with. It is very lightweigth and you can get the grip on it quite fast, just give it a try. But it can't export to .fbx, as well and its main purpose is the modelling (I think, it can do UV-unwrapping as well but no animation, etc.).
  18. I hope so, too. The workaround presented in my second link has some serious drawbacks, as the lighting is calculated multiple times and some antialiasing-artifacts can be seen, but it works (kind of).
  19. Sadly, there doesn't seem to be any official way for doing so. This has been discussed in http://www.leadwerks.com/werkspace/topic/9676-camera-layers/ and http://www.leadwerks.com/werkspace/topic/9464-rendering-backgroundsforegrounds/ where the latter one shows a work-around, but I would definitely be interested in an official statement from Josh to this, since in my opinion it was a great strength of LE2.5 that you could say something like: world1->Render(); world2->Render(); context->RenderLighting(); And having the lighting calculated in screenspace only ONCE (not for both render-calls), since this is the way a deferred renderer works (http://www.leadwerks.com/files/Deferred_Rendering_in_Leadwerks_Engine.pdf)
  20. Nice to hear, you solved it yourself. I guess, the cause of the problem has something to do with this: (from http://www.leadwerks.com/werkspace/blog/1/entry-1226-new-build-provides-texture-lock-improved-tex-mapping/ )
  21. The discussion, gamecreator is referring to, is http://www.leadwerks.com/werkspace/topic/8659-implement-virtual-filesystem/ It will work for some script-kiddies but you can't do anything against a skilled hacker (at least I don't know of anything): He could just take all the files from RAM while the game is running.
  22. The problem about this is, that you can not really optimize stuff. There are different requirements for different tasks. For example with an FPS you have to make sure that some important things get through, like e.g. hits. On the other hand, it would be an overkill to really make sure that every position/rotation update is transferred. So you have to design your own protocol for this. If you just have a switch like "synchronize this object", you can't really differentiate between those, so you would either end up having too many losses or a flooded network.
  23. You can simply down-/upload assets by subscribing to them in the steam version of LE. They get downloaded automatically and are kept up-to-date.
  24. Sockets/WinSockets FTW! Highly compatible to each other (as long as you don't use WSA-functions) and free. I think, I read somewhere (probably in this forum) that you can also send arbitrary messages to any steamid.
  25. LE3 doesn't use the shaders.pak any more. Instead there should be a "Shaders" folder somewhere (most likely on top-level) in your project folder. Each material uses only one shader (and one for shadows), which includes the vertex- AND the fragment-shader in a single .shader - file. As far as I understand, you have to annotate, where the vertex-shader starts using @OpenGL2.Vertex (Just use the minimum OpenGL-version, your shader is compatible to.) And your fragment-shader should start with @OpenGL2.Fragment (Don't know if this is sufficient. Just have a look at one of the example-shaders in that folder.) Then in the editor you create a material and assign the shader. (Compiling of the shader is done while loading)
×
×
  • Create New...