SomaZ Posted February 20, 2017 Posted February 20, 2017 Sure thing. I will make some pics, while I try to find a solution for this mess.
Tempust85 Posted February 20, 2017 Author Posted February 20, 2017 Could you please post the code snippet and where to change it? My attempts crash the game or makes everything gray.
minilogoguy18 Posted February 21, 2017 Posted February 21, 2017 Every time I check this thread I feel like I'm visiting the Kennedy Space Center: you like everything you see, but you have no clue on what's going on or what people are talking about.
SomaZ Posted February 21, 2017 Posted February 21, 2017 Pics for @Archangel35757 : https://jkhub.org/albums/hVA4D Code for @@DT85: #if defined(USE_LIGHT) && !defined(USE_FAST_LIGHT) //possible things to show: var_Tangent.xyz, var_Bitangent.xyz, var_Normal.xyz, N out_Color.rgb = var_Tangent.xyz * 0.5 + vec3(0.5); #endif Just place it at the end of the main function of the fragment code. Soooo, that means, tangent code is completely off for glm models. Now I need to find out where the problem is ?_? Tempust85 and minilogoguy18 like this
Tempust85 Posted February 21, 2017 Author Posted February 21, 2017 I'd dare say somewhere around vbo_packtangent (something like that, not at my pc) in tr_ghoul2. @@Xycaleth, would you happen to know which part of the code?
SomaZ Posted February 21, 2017 Posted February 21, 2017 I kind of found a solution. It's ugly coding tough. https://jkhub.org/albums/0UTbu Maybe someone can find a real coding solution for it. I added some vector zeroing in tr_ghoul2. I'm not sure why this is needed, code doesn't look like its nessesarry. Now the code doesn't average the tangents of a surface anymore, but takes the tangent from a single triangle thats part of the surface. Edit:@@AshuraDX Edit2:Code change: It averages the tangents again, but still have to clear them before. Ramikad, Maksman, minilogoguy18 and 1 other like this
Xycaleth Posted February 21, 2017 Posted February 21, 2017 If you look closely, the normals still don't match (in the upper image). It's especially noticeable just above the upper leg guard. On the bottom image, they differ along the bottom edge of the belt. Is this outputting the normal map? Or the vertex normals?
SomaZ Posted February 21, 2017 Posted February 21, 2017 If you look closely, the normals still don't match (in the upper image). It's especially noticeable just above the upper leg guard. On the bottom image, they differ along the bottom edge of the belt. Is this outputting the normal map? Or the vertex normals?Yea, I know. I hoped nobody will notice it, since I fixed it already and didn't want to make new screenshots. I found a valid fix though. The tangent and bitangent buffers just need to be zeroed at initialization. That's it. Damn, this took a while... Tempust85, Stoiss, Psyk0Sith and 1 other like this
SomaZ Posted February 21, 2017 Posted February 21, 2017 Can you post a diff of your changes?https://github.com/DT85/OpenDF2/commit/d2f53319d5f75d8e1b7ff1f95b0e5def7b7ff188#diff-ea1716bf94809f6c7a58650ab2f063f1L3511 Archangel35757 likes this
Xycaleth Posted February 21, 2017 Posted February 21, 2017 Ah nice Good find! Archangel35757, Tempust85 and SomaZ like this
Archangel35757 Posted February 21, 2017 Posted February 21, 2017 @@DT85,@@AshuraDX - now we need a PBR workflow outline/tutorial for JK models.
Almightygir Posted February 21, 2017 Posted February 21, 2017 Good stuff guys. Looks like tangents for the older models are fucked (funky shading definitely visible), might be worth taking the attitude of: older models load, and work, but look bad... start working in fbx from now on guyzzzz. or something along those lines. Also, there's something fucky going on with the fresnel term on the spheres in the background, it's all kinds of weird. Let me know if you want me to take a look at the shader code. Question: how are you handling the importance sampling? in realtime? or using the split-sum equation Epic posted up in 2014? SomaZ and minilogoguy18 like this
Xycaleth Posted February 21, 2017 Posted February 21, 2017 The IBL in rend2 is pretty poor. The different mipmaps of the cube maps are just downscaled versions of the original. There's no importance sampling being done.
AshuraDX Posted February 21, 2017 Posted February 21, 2017 @@DT85,@@AshuraDX - now we need a PBR workflow outline/tutorial for JK models.I will try to write up something useful and provide the exporter preset I created for Substance Painter. But besides of that - any tutorial on PBR texturing in general will work for JKA too. Archangel35757 and Tempust85 like this
Archangel35757 Posted February 21, 2017 Posted February 21, 2017 @@Almightygir - nothing presently uses FBX. Only @@Xycaleth's FBX-to-GLM converter... which presently does not support animations.
Almightygir Posted February 21, 2017 Posted February 21, 2017 The IBL in rend2 is pretty poor. The different mipmaps of the cube maps are just downscaled versions of the original. There's no importance sampling being done.so gross SomaZ and Xycaleth like this
minilogoguy18 Posted February 21, 2017 Posted February 21, 2017 Still though, does improve this game quite a bit from it's base form even though it may not put it in with 2017 standards.
Tempust85 Posted February 21, 2017 Author Posted February 21, 2017 Fix makes sense, MD3 tangents are cleared beforehand. I tried to do this myself, but kept getting crashes so I must've borked it up good. Anyhow, superb job there @@SomaZ, you're a real asset to this mod! Archangel35757 and SomaZ like this
Tempust85 Posted February 21, 2017 Author Posted February 21, 2017 Updated the DF2 build folder so whoever wants, can have a play with PBR or even just normal maps. GL2 is now the default renderer, but just incase it's not - "cl_renderer rdsp-GL2; vid_restart" in the console. I suppose I better get moving on an updated menu that includes GL2 cvars. minilogoguy18 and Archangel35757 like this
minilogoguy18 Posted February 22, 2017 Posted February 22, 2017 My DF2 build is so out of date, I'm gonna have to take the time to update everything. @@Psyk0Sith, do you have all the maps for Gorc so that he can take advantage of the new render engine?
Psyk0Sith Posted February 22, 2017 Posted February 22, 2017 Nope, because i didn't think PBR was a possibility at the time. I suppose i could put something together later down the line. Tempust85 and Archangel35757 like this
Tempust85 Posted February 22, 2017 Author Posted February 22, 2017 Grab the latest exe and dlls from the DF2 build folder - I've removed the need to use a shortcut or load the mod from the mod menu in-game. Alot of GL2 cvars are now set to enabled by default. This includes cubemapping & PBR, and I've also changed the default gloss type to be roughness instead of smoothness. Archangel35757 likes this
AshuraDX Posted February 22, 2017 Posted February 22, 2017 If you intend to use GL2 as your main Renderer, you will have to redo all of your Materials for everything. You also will have to think about replacing all base JKA models with models made to support PBR. Updating base JKA models with proper normal maps will be just as much work as making new models. Keep this in mind when making that decision.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now