Jump to content

Josh

Staff
  • Content Count

    16,063
  • Joined

  • Last visited

Community Reputation

8,537 Excellent

About Josh

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male
  • Location
    San Francisco, CA

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Josh

    Beginning with Particles

    I see the "values" as being script-defined properties. I am offloading all the particle features and settings into Lua scripts so that there is no limit on the features particles can support..In LE4 we had fixed emission volumes, in the new engine you can add a script for a new emission shape of your own, or whatever you want. Does that make more sense now?
  2. I wanted to work on something a bit different, and this sure is different. I've got a framework of a new particle system worked out. What's really special about this system is the amount of interactivity the particles will allow. Particle-world collisions. Particle-particle collisions (repulsion) Particle-particle cohesion (fluids with surface tension) Instead of just being a visual effect, I want our new particles to be fully interactive with physics so that particles can exert forces on objects. This will allow you to simulate fluids, smoke, and other effects in a realistic manner, not just dumb collision of particles bounding off walls. It should even be possible to simulate hydrophobic and hydrophillic liquids if you mix two together with different cohesion values. Basically what I want is something like Nvidia Flow on the CPU and exerting forces on the world. So if you had water falling on a water wheel the wheel would move because of the forces, or a blast of wind could knock objects over without any special force fields or other fake effects. I also have a technique worked out that will allow lighting of clouds and other masses of gas, with back-scattering. Emitters can be instanced so if you have one really high-quality torch effect, for example, you can instance it and use it as much as you like without any additional computational cost per instance. Particle emitters can be controlled with a Lua script or C++ actor. Two new functions are available, UpdateParticle() and EmitParticle(). Here is a script that controls particle behavior over time: entity.particleVelocity = Vec3(0,0,1) entity.particleAcceleration = Vec3(0,-1,0) entity.inverseSquareFalloff = true entity.particleRadiusBegin = 0.1 entity.particleRadiusEnd = 0.2 entity.particleColorBegin = Vec4(1,1,1,1) entity.particleColorEnd = Vec4(1,1,1,0) entity.particleMass = 1 entity.particleSpin = 5 function entity:Start() self.particleColorBeginHSL = HSL(self.particleColorBegin.rgb) self.particleColorEndHSL = HSL(self.particleColorEnd.rgb) local emitter = Emitter(self) if emitter == nil then return end local n for n = 1, #emitter.particles do emitter.particles[n].mass = self.particleMass emitter.particles[n].falloff = (n-1) / (#emitter.particles - 1) end end function entity:EmitParticle(index) local emitter = Emitter(self) if emitter == nil then return end emitter.particles[index].position = self:GetPosition(true) emitter.particles[index].velocity = TransformVector(self.particleVelocity,self,nil) emitter.particles[index].radius = self.particleRadiusBegin emitter.particles[index].color = self.particleColorBegin end function entity:UpdateParticle(index) local emitter = Emitter(self) if emitter == nil then return end emitter.particles[index].velocity = emitter.particles[index].velocity + self.particleAcceleration / 60 local falloff = emitter.particles[index].falloff if self.inverseSquareFalloff then falloff = falloff * falloff end emitter.particles[index].color.rgb = RGB(self.particleColorBeginHSL * (1 - falloff) + self.particleColorEndHSL * falloff) emitter.particles[index].color.a = self.particleColorBegin.a * (1 - falloff) + self.particleColorEnd.a * falloff emitter.particles[index].radius = self.particleRadiusBegin * (1 - falloff) + self.particleRadiusEnd * falloff emitter.particles[index].rotation = emitter.particles[index].rotation + self.particleSpin / 60 end A different script could be used to make particles emit from vertices of a model, to make the model appear to be on fire, or other effects. This will allow infinite customization to create any behavior you want. Particle physics will be calculated on the physics thread so I expect them to be very fast.
  3. I quit the web cold-turkey, outside of this website and here is what I notice: Movies, music, and games, in physical formats, are very interesting again, like they used to be. I discovered an interesting mod for S.T.A.L.K.E.R. by browsing through game DVDs. I never would have found it looking online because I don't want to search through uncurated piles of trash. The idea of subscribing to a newspaper (Wall St. Journal) or magazine is actually pretty appealing. It gives you a bit of intellectual stimulation in just the right dosage. I have a much much better mood every day. Digital content delivered over the web results in an overload of information, combined with a race to the bottom in terms of quality. You can see this happening in real-time on Steam. Tool didn't even bother to release a real CD with their recent album, and the album is also really sub-optimal quality. The whole "streaming" thing seems ridiculous to me. Instead of exchanging money for a product, you are giving money so that a computer can be set up somewhere that will dynamically deliver the correct bits to your computer, while their legal team maintains licensing agreements with the content owner, until the day comes that one of those things stops happening. Yes, just about anything you want offline can be found online, but it's going to be a crappy version of what you could get offline. Streaming movies always freeze up, the sound is bad quality, you might have some weird subtitles you can't turn off. The whole experience is like looking at everything through really dirty goggles. Everything feels poorly put together like it might fall apart at any moment or be taken away. So although physical media has / is taking a huge hit, it seems like online content is on really a self-destructive path. I would not be surprised if the web turns into a garbage bin of mountains of data no one ever looks at, and owners just start pulling the plug on a lot of stuff. I don't know, but there is definitely something strange happening. I feel like everything in the consumer space has been exhausted and something big is going to change. It takes a bit of discipline to get through the first couple of weeks but it is so much better. I have the same feeling now that I have not had since the late 1990s. I can't force the rest of the world to do the same, but for my own life I feel like life offline is 1000% better.
  4. Josh

    Sprite Layers and the GUI

    Maybe it is being called somewhere else? I can’t tell without seeing the full program.
  5. Josh

    Sprite Layers and the GUI

    Just call GetEvent to retrieve the next event in the queue. If it is a mouse or hey event you can pass it straight to the GUI processEvent method.
  6. Josh

    Sprite Layers and the GUI

    gui->ProcessEvent() will send the event to the appropriate widget it effects. Those widgets may then emit an event for the widget action, which can be detected in the main event handling code like in your example above. So mouse and key events get send into the GUI and then may result in new events being generated. The reason it is done this way is it gives you precise control over the raw input, so you can do a 3D in-game GUI and control how the mouse events work.
  7. Josh

    Voxel Code

    In LE4 use Entity->Release(); In LE5 just set the variable to NULL. Frustum and occlusion culling are built-in. Surfaces can be cleared and re-built, but faces cannot be removed in LE4. In LE5 you can modify the vertex and indice arrays and then call Mesh->Finalize().
  8. Josh

    2D Drawing to Texture

    Here is what I came up with: void Camera::SetRealTime(const bool realtimemode) void Camera::Refresh() Refresh will cause a non-realtime camera to render once before it is disabled automatically, until the next refresh.
  9. Technically, 4,294,967,295 vertices is the max. But there will be a limit lower than that depending on your hardware. Very roughly I would aim for no more than 10,000-20,000 polys for any particular model.
  10. LE5 beta updated. Added 3D GUI example, missing newton double float lib.

  11. Josh

    3D GUI

    Putting all the pieces together, I was able to create a GUI with a sprite layer, attach it to a camera with a texture buffer render target, and render the GUI onto a texture applied to a 3D surface. Then I used the picked UV coords to convert to mouse coordinates and send user events to the GUI. Here is the result: This can be used for GUIs rendered onto surfaces in your game, or for a user interface that can be interacted with in VR. This example will be included in the next beta update.
  12. GUI is working in 3D space. Never did this before.

    1. gamecreator

      gamecreator

      How much of these new features are a challenge you enjoy versus a frustrating necessity?

    2. Josh

      Josh

      The features are pretty fun actually. I planned all this out to have this specific functionality work. Vulkan has been some of the most frustrating difficult stuff I have ever worked on (not as bad as Android / iOS stuff though) but the hard part of that is through I think.

  13. Josh

    Voxel Code

    If you keep developing this I would be interested in licensing the code to add a Minecraft-type game template to the new engine.
  14. A dynamic cast will return NULL if the conversion is not valid. (A static cast can potentially return an invalid object.) So you might want to also check if the result of the cast is NULL before continuing.
  15. Cast the Actor object to your custom actor object and the function will be available. See C++ dynamic casting.
×
×
  • Create New...