Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Neverwinter Nights: Enhanced Edition has been released! Visit nwn.beamdog.com to make an order. NWN:EE FAQ is available.
Soundtracks for BG:EE, SoD, BG2:EE, IWD:EE, PST:EE are now available in the Beamdog store.
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Billboard textures

zordren3742zordren3742 Member Posts: 188
So the speed tree. Models that I am porting from the witcher 2 use bill board textures for the branches and the leaves. Can nwn use billboard textures? If so how do you get them to render properly? The models I ripped have all the uvs set right you can see them when rendering in blender. But the billboard plate still shows.

Comments

  • symmetricsymmetric Member Posts: 52
    Apart from emitters, no. At least not with the default shaders.

    However, it is possible to write a custom vertex shader which would make meshes face the camera at all times.

    zordren3742
  • zordren3742zordren3742 Member Posts: 188
    I see,I Started to learn c++ but I'm not quite ready to write my own shaders just yet. You have to learn opengl shader code to do that,I think. So I will have to keep playing with it and see what I can come up with.

  • zordren3742zordren3742 Member Posts: 188
    Sorry I have not been able to test much the last couple of days..... Work. But I did get the tree in game with the billboards on, they do render right, only the leaves show not the plates. But yeah we need a custom vertex shader make them all show all the time from every view angle. I tried duplicating the mesh and placing two on top of each other and having one of their normals face down and the other facing up but it did not look that great.

  • zordren3742zordren3742 Member Posts: 188
    edited July 2018
    Well I had another feel dumb moment. The branches on the speed tree models are just a bunch of two sided mesh plains with a texture uv mapped to them. The leaves on speed tree models from the witcher 2 are hundreds of billboards, and after some testing, you CAN make nwn emitters produce the exact same effect as a billboard texture. The only down side right now is the witchers billboards also have normal maps and I do not think you can use normal maps with nwn emitters yet.

  • LaputianBirdLaputianBird Member Posts: 103
    Vfxs, billboarded or not, have a serious performance hit in NWN. If you are planning to use that technique for trees, it's going to be a nightmare - assume your trees will be used to create forested areas, which means dozens or hundreds on screen at the same time. Each with hundreds of billboarded foliage chunks.
    One of the best performance optimizations in NWN is that of cut down the number of meshes to render by attaching them together - which is precisely something you cannot do with emitters, as each particle is rendered individually (and dynamically). Normal/specular maps add another performance hit on top of that, not only because of the more complex texture setup, but also because they use more intensive shaders - which would be multiplied by the total number of particles/leaves on screen.

    VFXs also have the issues that they pierce through fog, and that they are very exposed to alpha mapping issues (which are rampant in NWN) so such a foliage would look rather odd as a result.

  • zordren3742zordren3742 Member Posts: 188
    edited August 2018
    It is in the works, and all will be revealed. I'm all for finding ways for beam dog to optimize the games engine lol. I do not know if it will happen, but here I go.

  • LaputianBirdLaputianBird Member Posts: 103
    edited August 2018

    It is in the works, and all will be revealed. I'm all for finding ways for beam dog to optimize the games engine lol. I do not know if it will happen, but here I go.

    Obviously I don't know what will happen in future, I'm just pointing out the current situation, in the spirit of contributing.

  • zordren3742zordren3742 Member Posts: 188
    edited August 2018
    It's all good, thank you for letting me know. I am still new to all of this.

  • LaputianBirdLaputianBird Member Posts: 103

    It's all good, thank you for letting me know. I am still new to all of this.

    Just pointing out that it isn't the first time someone has the idea to use billboarded texture to achieve such results, and it never worked out due to the issues I mentioned. So unless there is some serious improvement in the engine, the risk is you'll invest a lot of time into something that at best will "sort of work" for experimental purposes but that won't be suitable for actual usage in live modules

  • zordren3742zordren3742 Member Posts: 188
    I wrote a request in the general forums that they add the ability to make multiple emitters use the same settings data in a mdl. Also it would be nice if they could some how be set as a group of meshes that act as if they are shaded like a single one. But Idk we will have to see what response we get.

  • LaputianBirdLaputianBird Member Posts: 103

    I wrote a request in the general forums that they add the ability to make multiple emitters use the same settings data in a mdl. Also it would be nice if they could some how be set as a group of meshes that act as if they are shaded like a single one. But Idk we will have to see what response we get.

    The request you posted won't help, even if it's implemented. The issue isn't the number of mdl lines, because that isn't a relevant factor with performance, not even with loading times (a much much bigger factor is whether the model is pre-compiled or in ASCII, and the type of data it contains). The ability to Instance the nodes to avoid rewriting the same blocks of data in the .mdl ASCII is like expecting an improvement by zipping the file for uploading. The ASCII .mdl file is just a delivery format, the engine uses it to compile the model in memory. Even if the same node was read in a loop, for instance, and placed at a different location every time, from there the engine would still have to handle the same n nodes that it would need to handle without the instancing (in the analogy, after "unzipping" the data).
    Moreover I cannot see any way to add an instancing system in the current ASCII format.

    Group shading isn't really possible either, as far as I know. It would require some heavy changes in the way the engine uses the GPU, as right now I believe everything is pretty much sequential and per-node. It is a bottleneck, but also the fact that it hasn't been changed so far (in spite of the benefits it would bring, not only for emitters) hints at the depth of the engine rewrite that it would require

    zordren3742
  • zordren3742zordren3742 Member Posts: 188
    That is good information that I did not know. I suppose it did not hurt to ask. If it would require a massive rewrite of the code, I do not think it is something we should expect either. At least not until bigger more important things are taken care of. But who knows, this might be a good thing to ask about in a live stream.

  • LaputianBirdLaputianBird Member Posts: 103
    Asking never hurts, and it isn't like BD releases much info about their plans, so who knows

    zordren3742
Sign In or Register to comment.