Jump to content

Ma-Shell

Members
  • Posts

    371
  • Joined

  • Last visited

Everything posted by Ma-Shell

  1. What does the code for differently coloured letters look like? Do you call CreateText once for every letter and then position them manually or is there a nicer way?
  2. Is it possible to combine more than 2 worlds (possibly by daisy chaining them)?
  3. I see two possible issues with filters: 1. I understand a filter as having some sort of "layer-id" on the objects and a camera only rendering objects with a given layer-id. Suppose, you have two objects A and B. If you want to first render A and B and then from a different camera only B (e.g. you have a vampire in front of a mirror. You would want the entire scenery to include the vampire but when rendering the mirror, you would want to render the scenery from that perspective without the vampire). This would not be easily possible with a layer-id. 2. Performance: You have to run through all objects and see, whether they match the filter in order to decide, whether to cull them or not. If you instead just walk the world's list of entities, this does not happen. Why not using something like this: camWorldA->SetClearMode(ColorBit | DepthBufferBit); camWorldB->SetClearMode(DepthBufferBit); camWorldC->SetClearMode(DepthBufferBit); context->ClearWorlds(); // nothing is being rendered context->AddWorld(worldA); // All cameras of world A are rendered context->AddWorld(worldB); // First all cameras of world A are rendered, then all of world B context->AddWorld(worldC); // First all cameras of world A are rendered, then all of world B, then all of world C This would give the user maximum flexibility and only require the context to hold a list of worlds, which are rendered one after another instead of having a single active world. For compatibility and comfortability reasons, you could additionally define void World::Render(Context* ctx) { ctx->ClearWorlds(); ctx->AddWorld(this); } This way, you could still use the system as before without ever knowing of being able to render multiple worlds. EDIT: I see, my vampire wouldn't work with this system, as well (unless you allow a mesh to be in multiple worlds) but I still think, this is quite a flexible and easy to use system without much of an overhead
  4. Isn't that basically what a world is? Each camera renders only the objects that are in its world, so the world is basically a filter for the camera
  5. Ah, I see... So the rendering always uses the last world, which called World::Render() and uses all cameras from that world in the specified order? Would it be possible to implement the same ordering as with cameras for worlds then? Like the following realWorld->setOrder(1); HUDWorld->setOrder(2); where it would first render all cameras from realWorld and after that all cameras from HUDWorld. This would probably mean, it is more intuitive to have the render-call on the context instead of the world, since all worlds would be rendered. By the way, is there any way to disable certain cameras, so they get skipped? Like setting a negative order or something like this. What happens if you set two cameras to the same order?
  6. You mean, because unlike the previous version the user does not directly call Render() anymore, since it is run on a different thread and thus the user can not correctly orchestrate the rendering? This should not be a problem, since in CreateCamera you can specify the world. auto realCamera = CreateCamera(realWorld); auto HUDCamera = CreateCamera(HUDWorld); realCamera->setOrder(1); HUDCamera->setOrder(2); realCamera->SetClearMode(CLEAR_DEPTH | CLEAR_COLOR); HUDCamera->SetClearMode(CLEAR_DEPTH);
  7. Would it be possible to use two different worlds for this? One "real" world and one for your HUD and then first rendering only the first world and after that rendering the HUD-world.
  8. The model probably does not have a surface. You should get the number of surfaces first and then iterate over the surfaces. Something like the following (I don't know much about lua, so probably this code won't work without modification): for k,v in pairs (self.modelTable) do for i = 0, v:CountSurfaces(), 1 do surface = v:GetSurface(i) mat = surface:GetMaterial() mat:SetShader(shader) shader:SetVec4("ex_color",self.color) mat:SetColor(self.color) self.modelTable[k] = nil end end
  9. As I said, you should take a look at the objects on your map and the scripts they have attached!
  10. I am pretty sure, the problem is coming from a LUA script of an object in your map, not from C++. That script has probably a world render or update hook, where it tries to access that variable.
  11. No, the comment "//lua" only means that this function is available in lua, as well, but that does not mean, that it is only executed in lua. As for your other problem, it seems like you might not be setting the variable "world" before calling the Update-function or you are probably setting a function-local variable in the Start-function and then accessing a global variable in the update function or something like that. It's hard to say without seeing your code.
  12. Also, looking at https://www.gamedev.net/forums/topic/673534-instancing-and-the-various-ways-to-supply-per-instance-data/?do=findComment&comment=5264179, you can create the buffer much larger first, then copy all data and later repeatedly use glBindBufferRange instead of glBufferSubData, copying all data in one go and being much faster
  13. ah, I see, so you're refering to GL_MAX_UNIFORM_BLOCK_SIZE (https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGet.xhtml)? I think, it would make sense, to query that number in the beginning and use that instead of the fixed 256. Otherwise every system would suffer, only so that it can run on lower end systems. EDIT: Of course I mean use that number divided by 64
  14. Doing a performance-test with LW 4.7, I wanted to draw an element ins tanced multiple thousands of times. Using RenderDoc I found out, that Leadwerks batches these into groups of 256 elements each, so instead of having one call to glDrawElementsInstanced, instead I have quite many (which in my eyes are not needed). Also looking at the shaders, I found that they usually have a line like #define MAX_INSTANCES 256 I believe that there is a lot of wasted potential because of this for rendering large groups of the same entity. Is there a reason for this limit? Can we increase it somehow? Will the same limitation be there in Turbo? I have attached the source code for my test. App.h App.cpp main.cpp
  15. You probably need to install libcurl4. Try using sudo apt-get update sudo apt-get install libcurl4-openssl-dev
  16. How long until you get the Top Secret Tesselated Toad Tech? ?
  17. One should also note that there are basically two different Debugging modes: The option you changed affects only the Code Generation process. This means that the Debug version will set some compiler flags, which might enable some runtime checks in the libraries that were included and it also might disable binary optimizations. However, independent of whether you compiled a Release or a Debug version, you can start your executable with a debugger attached or without one. The debugger running on the release version will usually not give you as useful results as on the Debug version, as the Release version might optimize your code by removing some variables or unnecessary code. However, it is still possible to debug the release version and set breakpoints etc. So for maximum performance you should switch to Release version and then choose "start without debugging" (in the debug-menu)
  18. You can not 100% protect the game files. You can only make it hard enough for an attacker to eventually give up and lose interest in deobfuscating what you did. The reason, why it is not possible to protect the files is that the pc must be able to execute and therefore decrypt your files and an attacker can simply e.g. attach a debugger to your program and read the contents from memory or reverse engineer the decryption-process. For this reason, one option for an attacker to cheat is by simply modifying the game files. For multiplayer games, an attacker can actually simply send data to the players / the server, without even touching your game files, if they figure out the protocol you are using. They can learn about your protocol e.g. by simply analyzing networking-dumps. The other party does not have any possibility to check that the data was sent from your program and not from any other program capable of sending networking-packets.
  19. Why would the server do that? It should instead just tell the client the correct current state, the client takes this state as the new truth (it might use some smoothing operations, so the objects don't flip around) and starts simulating from that new state again... No need to simulate the past, if the actual current state is known. This network-model you are describing is called "client side prediction" and by googling that term, you should be able to find lots of articles to help you further with this.
  20. You can see in the file "Leadwerks\Include\Classes\Drivers\Physics\NewtonDynamics\NewtonDynamicsPhysicsDriver.h", that the PhysicsDriver has a reference to the collisionWorld, which is a NewtonWorld pointer. You can get the current physics-driver from "_currentPhysicsDriver" but you need to cast it to a NewtonDynamicsPhysicsDriver, thus: ((NewtonDynamicsPhysicsDriver*)(_currentPhysicsDriver))->collisionWorld should be the droid you're looking for. (I haven't tested this but I am fairly certain, this will work)
  21. The warning about spectre does not have anything to do with that linker error. Could you verify that the lib-file exists? It should be most likely in (the number might differ) C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86\libcpmtd.lib Furthermore make sure, the path, where you found the library is found in the Library Directories (in the expanded form of the $(VC_LibraryPath_x86) variable) of your active configuration (see image below) Also make sure, you are using the correct platform toolset: General -> Platform Toolset should be set to "Visual Studio 2017 (v141)" (at least it is for me )
  22. (https://www.leadwerks.com/community/blogs/entry/2387-getting-started-with-vulkan/?tab=comments#comment-10207) So, do you wish to take back that statement or did you now find other ways to optimize that were not possible in the OpenGL implementation? Anyway, I'm happy, you decided to go with Vulkan
  23. Which bootloader do you use? In the case of grub (Ubuntu default), you can press "e" before the countdown runs out and then modify the boot-string by simply appending "init=/bin/bash" to the end of the line which starts with "linux /boot/vmlinuz...". You might need to manually mount your harddrives before you can access them, not sure.
  24. Just remove "exec". As @aiaf mentioned, by writing "exec", the process running the bash-script is replaced with the new one and thus the script is not further executed. Just leave out that one word and you should be fine.
  25. Don't know about shadmar's one but you can try that one:
×
×
  • Create New...