Jump to content

Wchris

Members
  • Posts

    281
  • Joined

  • Last visited

Everything posted by Wchris

  1. Your choice. Just suggesting. But there could be a global parameter to set PhysicsSetPosition() and PhysicsSetRotation() behavior/mode Is "managing secret things" not what game engines do all the time ? LOL I just have the feeling that creating joints is an advanced feature that could look difficult to understand for beginners. Maybe I'm wrong. Don't do it just for me, it's just an idea, not a request.
  2. Woaw this looks sweet ! Is it not possible to keep PhysicsSetPosition() and PhysicsSetRotation() commands and internally call the new SetTargetPosition() and SetTargetRotation() by creating a default Kinematic joint when called the first time ?
  3. Hi. Juste Reading your post. Did you fix the issue ?
  4. had an idea, but my try to reproduce the scene and issue failed. Still curious, what happens if you increase the size (scale) of all objects x10 ... or x100 ? Does it change the result ? In Josh's link they say "make big walls" so maybe the solution is " make big objects" ?
  5. Wchris

    Water

    Exactly I find this water more transparent and less reflective (no mirror effect) than the current provided one. But I believe he is not using post-processing and no multiple renders. You are right the principle is the same, but the settings are different and current waterplane has not enough properties exposed to configure it to look like this (and I get lost tweaking the shader directly).
  6. Wchris

    Water

    I had exactly the same questions as you some weeks ago, and also tryed cheapwater. I ended up trying to fix an old LE3 widget from Shadmar, my result is here http://www.leadwerks.com/werkspace/topic/14778-why-do-i-get-red-water/ but it is still experimental, I'm no shader guru. But I would prefer and official solution for animated water, because this plugin does not have water physics. I'm 100% sure Josh can do it, he did it in the past but was not satisfyed by the result. He should not be so perfectionist, 90% of people were happy with the solution he had, many event buyed LE2 because they saw the beach fps demo . Current "flat" mirror waterplane is indeed not realistic at all, water is never flat like a mirror in a game (even if it can be in reality without wind) people just expect it to look "living" and have waves and ripples . For the newbies this is how it looked like in 2009 !!! and why I say he can do it. Also I feel really scared of doing things wrong when I mod shaders, I would really like the engine to do this job.
  7. If you choose category "shaders" and type "all items" you get 2 pages of shaders. But if you click on page 2 or "next page" then category is reset and you will never see page 2 of shaders but page 2 of "all category" Also, tryed to PM you this info, but you did not see it.
  8. yes it works, but I'm just a beginner experimenting things so it's still 99% Shadmar's work, I just tweaked it while learning shaders. I would still prefer LE4 to be natively able to animate the water by providing a listbox under the scene root to add all animated normal maps and handle them itself. The biggest issue is that the water has no physics, it's just a visual, nothing will float and move with the waves. Here is the file : Shadmar_Water_with_examplemap.zip ask me if you need instructions
  9. I know it's from LE3 (the link of the thread where I found it is provided in my first post). I did not find another water shader for LE4 and could not find how to animate current default water in LE4. So I tryed to use this one.
  10. What are the commands for bitwise operations ? I'm a complete beginner, maybe it is worth mentionning these commands in a tutorial. If it is allready in a video tutorial, please point me to it because I missed it and need to rewatch.
  11. I also wondered about this, but in the vertex stader he is adding 10 that's why I substract 10 to cancel this //If an object is selected, 10 is subtracted from the alpha color. //This is a bit of a hack that packs a per-object boolean into the alpha value. if (ex_color.a<-5.0) { ex_color.a += 10.0; ex_selectionstate = 1.0; } ex_color *= vec4(1.0-vertex_color.r,1.0-vertex_color.g,1.0-vertex_color.b,vertex_color.a) * materialcolordiffuse; } I find it very difficult to understand what happens to "alpha chanel-10" once multiplied by the vertex_color and materialdiffuseI But 10 (00001010) contains the 2 (00000010) bit. I believe in binary addition and substract work like a bitwise boolean operation. You probably allready know this, but if someone else is reading he won't understand what we are talking about, so I'll explain binary additions and substractions a little. if you take 255 it is 11111111 in binary if you take 10 it is 00001010 in binary if youn take 2 it is 00000010 in binary if you do 255 - 10 in binary you get 11111111 - 00001010 = 11110101 = 245 if you do 255 - 2 in binary you get 11111111 - 00000010 = 11111101 = 253 you can try it here http://www.calculator.net/binary-calculator.html?number1=11111111&c2op=-&number2=00000010&calctype=op&x=84&y=16 I tryed it, and the fix also works with -2 instead of -10, so you are probably right. But when I tryed a bitwise operation and with "&& 253" or "& 253" shader failed to compile. Cheers PS: back to the shader tutorials #3 is waiting for me after a good night of sleep (by the way Is there a wiki about leadwerks shaders somewhere ?)
  12. Hi, I learned some tricks from your tutorial 2, like how to transform a Vec4 into a Vec3.xyz+vec3.a to remove/tweak the alpha channel separately and set it back. I came up with this modification where I re-substract 10 to the alpha chanel to remove Leadwerks "red selection boolean" #if BFN_ENABLED==1 //Best-fit normals fragData1 = vec4(texture(texture15,normalize(vec3(normal.x,-normal.y,normal.z))).xyz,texture(texture15,normalize(vec3(normal.x,-normal.y,normal.z))).a-10); #else //Low-res normals fragData1 = vec4(normalize(normal)*0.5+0.5,fragData0.a-10); #endif It works but I see no difference compared to the version where fragData1 is completely commented out. An alternative is to remove the apha chanel completely and set it to 0 in the vec4 with the same result. I believe something is still wrong because I do not see the water go up & down at the shoreline.
  13. Oh tutorial ? is this tutorial from you ? I will definitely watch all those shader tutorial videos and attempt to understand what I do ! Thanks a lot !
  14. After experimenting, it turned out I had to comment those lines to get it working #if BFN_ENABLED==1 //Best-fit normals //fragData1 = texture(texture15,normalize(vec3(normal.x,-normal.y,normal.z))); #else //Low-res normals //fragData1 = vec4(normalize(normal)*0.5+0.5,fragData0.a); #endif I know nothing about shaders, what is fragData1 supposed to do ?
  15. Thank you very much for the hint, this info definitely will be a great help. I had no idea what was going on. Thanks !
  16. New puzzle for the community with an artistic result in an atempt to animate water (because current LE4 waterplane cannot be animated right ?) I downloaded an old LE3 Shadmar exemple "Water_with_examplemap" from this old thread http://www.leadwerks.com/werkspace/topic/10794-needing-help/#entry79138 It took me 2 days to figure out I had to use "drag & drop" to drag a camera to the Script.CameraOrPlayer=""--entity field and now it works but I my water is red. Can someone explain me why the water is red instead of blue ? Thank you PS: had to put a camera2 in the scene and modify this line self.camera=self.CameraOrPlayer.script.camera or self.CameraOrPlayer with this self.camera=self.CameraOrPlayer Otherwise it will crash if there is no FPS player attached to the CameraOrPlayer field
  17. It was reported as not working well in bug section http://www.leadwerks.com/werkspace/topic/13879-bad-water-reflections-with-vegetation-system/ Also is there an official way to animate the water ?
  18. In real nature waves are produced by the wind (depends on wind force, duration, distance) and near the island the seabed irregularities have an influence. Without wind, no waves. The problem is we don't have the processing power to fully simulate this in a game. My idea is exactly to manually simulate the wind effect and start waves in a given direction. this wont work with spectator camera or airplanes views. We could set the island center point, but this would not work is the island shape is a crescent or another fancy shape. PS: anyway since my solution is not a math puzzle, chances are very low Josh will be interrested by the idea
  19. This brings us back to the initial problem, an island is round... how to make them parralel when an island is round ? Also I speak from the waves in the back in the picture, not the foam on the beach. Anyway Josh & Sharmar will do a better job than me, that's why I prefer using the suggestion box.
  20. By waves I mean Sea Waves with foam that progress to the shore, not just water wobling. Like in this image Also I prefer staying at the practical/theory level because Josh knows better how to do it technically.
  21. When i see Shadmar's water screenshot I remember old LE 2.x days when Josh tryed to make seawater and waves. There was a cool demo with a beach and a floating wood branch. By the time I had found the result was nice but not good enought for some so it was dropped in favor of an animated texture. The main issue was the waves that would be parallel to the beach on one side of the island, but perpendicular on the other sides. Of course perpendicular waves look unnatural, but the animation had no way to know the islands location. My idea to solve this would be to add a new feature to the editor. A special asset called "Wave generator" It would be a line (or a spline to make the maths more funny and not boring ^^) we could place in the editor, with, in the middle, an arrow for direction indicator. we cloud set the line/spline size, orientation, distance to beach, wave height, wave "decay" rate, spawn interval. it's not trivial because you'll have to manage automatic decrease of spawn interval when camera is far away, and don't compute waves out of camera view but still move the line, and of course do all the 3D stuff. i'm sure people would love positionning their waves in the editor :-) Cheers PS: I imagine the wave line would work a bit like moving a "vertex magnet", but of course I don't know what's technicaly the best way.
  22. I would suspect the physics engine. Did you try to set the gun mass to zero to disable physics and see if it changes anything ? or remove collision settings from the gun ?
  23. Thank you very much Josh ! you were a great help, I have learnt something. Time to go back to the code.
  24. What strange is that I do the same mistake with model = Model::create(); Model->Load(...) instead of model = Model::load and it works, do you have an idea why ? Sorry I'm still a beginner in C++.
  25. Hi Josh You found the explanation and saved my day. As a reward I'll tell you why we got there I started from this example of setmaterial http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entitysetmaterial-r183 and could have avoided the pitfall if I used the load exemple http://www.leadwerks.com/werkspace/page/api-reference/_/material/materialload-r266 If you refer to the fact that my avatar remained invisible, it was because since LE3 armageddon and loss of possibility to use other alternative programming languages I was not using the engine anymore, but I still loved Leadwerks for the simplicity of it's command set and visuals. Since I was not using the engine and had nothing to exchange with the community I decided to go invisible. Why I'm back after so long ? Well, because after version 4 of Leadwerks I realized that people who were working on a SWIG wrapper finally failed. So I started writing my own called PWIG (Pascal Wrapper and Interface Generator). This forced me to install VC++ 2013 and learn the basics of C++ to tell my generator how to code in C++ for me. Stay relax, I perfectly understand you want to promote lua since it provides you more visibility of what people can achieve; it makes sense. Since I do not have enought knowledge of C++ and cannot provide good support I will not promote my work and this time it will stay a private work. So don't fear an alternate programming way will emerge, it won't happen this time. I really like some of the C++ features I discovered even if I still dislike his SMS style syntax. But one syntax flaw that made PWIG generate the code above is that there is no clear specification of the constructors in the class. In Pascal you must specify the keywords constructor/destructor but in C++ you can have as many as you want and specify nothing, so LOAD is a constructor that replaces CREATE but no way to know. And this leads to errors if you use a class and are not it's conceptor, errors that even you have difficulty to spot because of the ambiguity of the language. Cheers Thank you PS1 : I have awaken because VC++ can finally compile the code PWIG produces (It restored my willpower) but I have no idea how to solve the constructor enigma yet. PS2: Please don't tkink I prefer Pascal because of the syntax. It's not really the main reason. I prefer it because of the Component API build on top and integrated with the IDE. It simplifies my work and makes the code easyer to manage. C++ is great but I prefer to work with a small subset than being overwhelmed, I just like simplicity. I guess people who love Blitzmax think the same way.
×
×
  • Create New...