Jump to content

FEATURE: OpenGL 3 Renderer


Recommended Posts

Funny thing is, that the bsp stores the misc_cubemap and the misc_dlight entities as normal text. At least Notepad++ can show them. Maybe it is possible to save directly to the bsp, or? Is bsp streamed? I need to investigate. :)

 

@@DT85 I have no idea how to handle UIs in the JK code. Your help would be greatly appreciated.

 

@@Archangel35757 Why? Lights from the game doesn't get stored. It's just about dynamic lights.

Link to comment

The only reason we need dlights is because with just lightmaps, the normal/parallax maps do not show at all.

 

 

@@SomaZ

 

What I meant was that I can create the .menu files. :P

 

Doom 3 from what I understand, compiles its maps at runtime. Might be worth having a look into that, but I'm thinking just using an external entity file would be best.

minilogoguy18 likes this
Link to comment

@@DT85 Sry, to answer the questions for AshuraDX.

It should look kind of like this:

 

 

He used a roughness map. So glossType 2 (Roughness)

The albedo map is kind of a diffuse map. Though it lacks every other shading like AO. This is because of the metal rougness workflow. Reflection color is controlled by the albedo map + metalness maps. AO is classicly applied after getting the reflection color from the albedo to get the diffuse color.

For this video I used the diffuse instead, since ao map handling is not presend at this moment.

minilogoguy18 and Maksman like this
Link to comment

Reflection color sure, but should the albedo be used to set the reflection intensity? Just seems a bit stupid to me.

 

Nonono. Reflection intensity is implicitly controlled by the metalness and albedo map. Sharpness of the reflection is controlled by the gloss or roughness map.

Shader Code (a little bit simplified):
specular.rgb = metal * diffuse.rgb
diffuse.rgb *= 1.0 - metal;       (metal objects have a black diffuse, but we get the reflection color from the albedo, see the line above)
//code that is missing right now:
diffuse.rgb += AO * aoStrength;   (this is kind of the classical diffuse map)

So, the only maps you need for the pbr metal roughness workflow are albedo, normal and a packed texture with grayscale metalness in the red, grayscale roughness in the green and grayscale ao in the blue channel. The specular textures AshuraDX supplied are the packed textures. With that you can build the .mtr

{
  map models/weapons2/clonedummy/body_albedo
  rgbGen lightingDiffuse
}
{
  stage normalmap
  map models/weapons2/clonedummy/body_normal
}
{
  stage specularmap
  map models/weapons2/clonedummy/body_Specular
}

I hope that clarifies things a bit.

Link to comment

Could be an issue for other models, but Ashura's clone normal maps require the model to be completely smooth.

 

@@AshuraDX

 

I had to invert the normal map textures green channel.

 

As-is:

 

2cenhqv.png

 

 

Body_Specular red channel inverted:

 

29c83uo.png

 

Forgot to mention, this is an MD3 loaded using misc_model_static.

 

@@SomaZ

 

Just make the alpha channel of the diffuse the AO or if the specular blue is unused in PBR, use that.

minilogoguy18 and AshuraDX like this
Link to comment

Is there anyway to maybe change the renderer to not need to invert any channels? Just so that it can say take a map generated from something like xNormal and have it usable. I know inverting isn't that big of a deal but there could be people out there who get confused and maybe don't know they have to adjust the maps. Also, having the render engine more in line with what most other software would render properly could help like say in Softimage I have the AT-ST set up so that the realtime shaders show the model with all the maps applied in the viewport. If I inverted a channel on the normal map it'll work in game but I lose the ability to make it viewable in Softimage and there are also sites like sketchfab.

Link to comment

Is there anyway to maybe change the renderer to not need to invert any channels? Just so that it can say take a map generated from something like xNormal and have it usable. I know inverting isn't that big of a deal but there could be people out there who get confused and maybe don't know they have to adjust the maps. Also, having the render engine more in line with what most other software would render properly could help like say in Softimage I have the AT-ST set up so that the realtime shaders show the model with all the maps applied in the viewport. If I inverted a channel on the normal map it'll work in game but I lose the ability to make it viewable in Softimage and there are also sites like sketchfab.

Inverting channels is something you won't get around in the testing phase.

 

Depending on the shader the definition for white on the normal maps green channel can be +y or -y.

Your normal map has to match what the shader expects.

Most dedicated render engines have a switch for this, so you can use both types of maps. I'm sure your Softimage shader has that option too. A switch like this could probably be added to the .mtr files.

Here are the normal map settings on sketchfab:

18424f684d5c52e85d3d7b65ebbe80e6.png

 

Same with a roughness/gloss map.

A roughness map is created with the logic that white is rough and therefore not shiny. A gloss map does the inverse, white is smooth and shiny.

 

Until we got this figured out, theres a bit of inverting to do.

Once everything is figured out, we can write a guide on this.

 

The main Problem with PBR will be, that barely any of our models for this game support it.

And a conversion is not an easy, 1-click process, there are tools to convert Photographs to full PBR materials that could be tested on jka map textures - but it won't yield decent results on playermodels or weapons. Theoretically everything would have to be remodeled and retextured following the modern pipeline.

 

@@DT85 I allready advised @@SomaZ to invert the normal maps green channel, and he did that. The screenshot was taken after the inversion, this is allready the better of 2 results he got.

But he used the GLM version, maybe something about the normals on glm meshes ingame is screwed up.

 

okay, invert the red channel again please. this made the cloth parts even more shiny.

Also: I allready put the AO map in the specular maps blue channel. The Diffuse alpha channel is the Material alpha - used to define transparency.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...