RobertBeckebans / RBDOOM-3-BFG

Doom 3 BFG Edition source port with updated DX12 / Vulkan renderer and modern game engine features
https://www.moddb.com/mods/rbdoom-3-bfg
GNU General Public License v3.0
1.45k stars 253 forks source link

particles with Diffuse/Bump/Specular render black or fail to render at all #337

Closed BielBdeLuna closed 4 years ago

BielBdeLuna commented 8 years ago

I wanted to try those particles: https://www.sendspace.com/file/518rui

which use a material with something like that:

//cloud particles that react to light
textures/particles/TEST/TEST_4
{
   noSelfShadow
   noshadows
   translucent
   discrete
   twosided
   nonsolid
   noimpact

   qer_editorimage      textures/particles/LIGHTTEST/cloud_test.tga

   {
       blend  diffusemap
       map    textures/particles/LIGHTTEST/cloud_test.tga
          vertexcolor
   }
   {
       blend  bumpmap
       map    textures/particles/LIGHTTEST/cloud_test_local.tga
      vertexcolor
   }
   {
       blend  specularmap
       map    textures/particles/LIGHTTEST/cloud_test_s.tga
      vertexcolor
   }
}

but they render invisible (the mesh of the particles is there but the texture/material is missing)

I tried:

textures/particles/lightest
{
   //noSelfShadow
   //noshadows
   //translucent
   //discrete
   //twosided
   //nonsolid
   //noimpact
    //translucent
    //noShadows
    sort        10

    //qer_editorimage     textures/particles/lightest/cloud_test.tga
    {
        blend diffusemap
        map     textures/particles/particle_normal.tga
        vertexcolor
    }   
    bumpmap     textures/particles/particle_normal.tga
   //{
   //    blend  specularmap
   //    map    textures/particles/lightest/cloud_test_s.tga
   //   vertexcolor
   //}
}

to see if at least I could see the particles as a series of squares with the textures and some light interaction but then it renders black.

in dhewm/doom3 it used to work.

if instead of "blend diffusemap" or "bumpmap" I just do a "blend blend" the particle renders fine without any light interaction ( as it should with "blend blend" )

does this mean that the there pixel shader missing for the particles?

motorsep commented 8 years ago

Particles can not have diffuse/bump/specular, they can only be blended or additive.

BielBdeLuna commented 8 years ago

in dhewm3 and the original doom3 they could

BielBdeLuna commented 8 years ago

Motorsep how did you actually use the feathered particles, I've been looking at the code, I see the pixel shader, but I can't find it being called by the code, was that pixel shader called like the heathaze one from the material?

motorsep commented 8 years ago

in dhewm3 and the original doom3 they could

They were part of interaction shader. In BFG they are not. Plus it bogs down performance and renders wrong anyway.

Motorsep how did you actually use the feathered particles, I've been looking at the code, I see the pixel shader, but I can't find it being called by the code, was that pixel shader called like the heathaze one from the material?

By using soft particles shader in the material. I need to upload sample when I have time.

BielBdeLuna commented 8 years ago

ok, could it be turned into a particle variable instead of a material command?

BielBdeLuna commented 8 years ago

influence the color of the particle should be doable, maybe tint the material like the vertex color, and maybe the particle could gather the overall color in the particle vertices and tint those vertices with that color (gather both the contribution of direct and ambient light) so we could have particles lighten up by the color around therefore matching the level lightning

motorsep commented 8 years ago

Not sure what you mean and what you need it for, but engine is not designed for particles-lighting interaction. Also lighting interaction has nothing to do with feathered particles.

BielBdeLuna commented 8 years ago

obviously particles are necessary for generating an atmosphere in the map, therefore particles should be able to conform to the light in the map.

feathering and light interaction are two separate issues. How can the light interaction be added back up to the particles?

motorsep commented 8 years ago

obviously particles are necessary for generating an atmosphere in the map, therefore particles should be able to conform to the light in the map.

Which still has nothing to do with what this engine was made for. You want too much from dated tech that was design to cater specific type of game and content.

If you need all the bells and whistles, perhaps it's time to move to CryEngine 5 or UE4 (although since real-time lighting isn't its strongest suit, might want to go with CryEngine 5)

BielBdeLuna commented 8 years ago

as long as they are open source, but they are not! and this is important to me.

besides this, doom3 engine wasn't made for atmosphere? what? if there is an engine meant to create a specific atmosphere more than any other is doom3's

one thing is to have a piece of technology which doesn't fits the specifics of the needs another is to abandon the whole of an engine because a single piece of technology, which also should be implementable.