Jump to content

FEATURE: OpenGL 3 Renderer


Recommended Posts

Posted

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.

Posted

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
Posted

@@SomaZ grab my latest commit please and give it a good test. I reverted the images pool that Xycaleth did in the hopes of doing away with the sun & flare crashes. That, and I'd like our code to match ioq3 where possible.

SomaZ likes this
Posted

I haven't had a look to see how ghoul2 marks would work yet or how they even work in the vanilla renderer :/ so I'm not sure what needs doing.

Posted

@@DT85 exporting the cubemap works fine. Don't know what's the problem. It saves them in Documents\my games\OpenDF2\base\cubemaps\map_name\. The file extension is wrong though.

Posted

Lol, didn't know you had to type something in the console - thought it just happened upon map load. :P

 

Anyway, shouldn't it be 6 images output and not 3?

 

EDIT: Opened in PS and I get it now. :P

SomaZ likes this
Posted

@@AshuraDX few questions. :)

 

What should your clone look like with PBR?

 

 

Which gloss type would you think?

 

GLOSS
SMOOTHNESS
ROUGHNESS
SHININESS

 

 

Is the albedo map supposed to control reflection?

Posted

@@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
Posted

@@SomaZ you did create an MTR shader using the albedo, normal and specular (not spec) textures? The shader that was supplied was for vanilla renderer.

 

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

Posted

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.

Posted

can we get a further zoomed out shot @@DT85?

 

Somaz Tests showed some very wonky normals on the body.

EDIT:

 

Here are some pictures:

 

From @@SomaZ test Video

51b3ef56183c82feb7eda2e5a6c6cb5b.png

 

From Marmoset
c1d304624024abbd9b21a2e093af93c8.png

EDIT2:

Could you also do me the favor and try inverting the red channel of the specular map?

Archangel35757 and Tempust85 like this
Posted

@@AshuraDX Are the hard edges split into two separate ones? If I recall correctly, every vertex normal is smoothed for shading. Maybe thats the problem?

Posted

@@AshuraDX Are the hard edges split into two separate ones? If I recall correctly, every vertex normal is smoothed for shading. Maybe thats the problem?

If you are smoothing all the vertex normals-- doesn't that defeat making custom normals in the XSI files (and its Carcass compilation into the GLM file)?

SomaZ likes this
Posted

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
Posted

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.

Posted

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.

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...