gameboy Posted February 8, 2021 Author Report Share Posted February 8, 2021 I just discovered that the shadows of the pillars shining on the wall are also flickering. And the shadow on the edge of the door was also flickering. Quote Link to comment Share on other sites More sharing options...
gameboy Posted February 8, 2021 Author Report Share Posted February 8, 2021 @DanW58 I set the shadow quality to the highest in the game options, but the same problem still occurs. Thank you very much for your help. By the way, when will the new algorithm you mentioned be launched? Quote Link to comment Share on other sites More sharing options...
DanW58 Posted February 8, 2021 Report Share Posted February 8, 2021 (edited) I'm guessing in a month or two, but I don't know; I'm actually quite new around here. Anyways, the problem seems to be that there's a minimum shadow distance set somewhere, probably to avoid surfaces shadowing themselves, but that is not short enough for the existing art. I know I said this is probably a precision problem, but I'm changing my mind now... If it was a precision problem it would show at any distance from the shadow casters, not only at the shortest distances --the way it seems to occur. @Stan`Does this building have an ao? I'm not sure how to tell in Blender. Edited February 8, 2021 by DanW58 Quote Link to comment Share on other sites More sharing options...
gameboy Posted February 8, 2021 Author Report Share Posted February 8, 2021 @DanW58 Perhaps only he @vladislavbelov can tell us the answer. Quote Link to comment Share on other sites More sharing options...
DanW58 Posted February 8, 2021 Report Share Posted February 8, 2021 Well, he already did; he said next release. But I'd be curious if perhaps he remembers there being a minimum shadow length setting somewhere. Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 8, 2021 Report Share Posted February 8, 2021 39 minutes ago, DanW58 said: It's totally correct. There's no balcony; it's a terrace. The inside is lower than the periphery. I think you're looking at it the wrong way. Try it in-game you'll see. The bevel is okay, but the UV mapping should probably be adjusted. Quote Link to comment Share on other sites More sharing options...
DanW58 Posted February 8, 2021 Report Share Posted February 8, 2021 (edited) 1 hour ago, wowgetoffyourcellphone said: The bevel is okay, but the UV mapping should probably be adjusted. Very true. I can't sleep, so I'll tackle it right now. Probably just a matter of moving the edge on the UV map. By the way, I just notice the same shadow flickering problem on the terraces of guard towers. The strange thing is that it changes as you rotate around the tower. Going back to thinking this is algorithmic. Edited February 8, 2021 by DanW58 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted February 8, 2021 Author Report Share Posted February 8, 2021 @DanW58 I am looking forward to your new graphics file and I will test it for you. Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 8, 2021 Report Share Posted February 8, 2021 1 hour ago, DanW58 said: Going back to thinking this is algorithmic. Right, although some models should probably be tweaked, overall I think it's a shadow rendering issue rather than a mesh problem. 1 Quote Link to comment Share on other sites More sharing options...
DanW58 Posted February 8, 2021 Report Share Posted February 8, 2021 No, exactly, this is a software problem. We should make sure all models have AO, though; I'm not sure this does; if it does it's kind of weak. The space behind the columns should already be pretty dark from the AO, then even the flickering of the direct shadow wouldn't be so noticeable. Done. ptol_civic_centre.dae Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 8, 2021 Report Share Posted February 8, 2021 It has an AO texture. See https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/art/actors/structures/ptolemies/civic_centre.xml The material xml tag + “aoTex” tells you it does. If you want to see whether it does in Blender rather than in the game look whether a mesh has too UV sets (that's usually it) Just in case it could make it easier for you, I wrote a blender plugin to import actors directly it doesn't import AO maps yet but I suppose it could. Most people play without AO specular and normal maps and parallax normal maps of for performance reasons. (Using the shader quality slider in the options) 1 Quote Link to comment Share on other sites More sharing options...
DanW58 Posted February 8, 2021 Report Share Posted February 8, 2021 Stan, I found the ao png, and it looks good; but I wanted to see it on the model, so I loaded it into Blender in the UV editor, and went back to the 3D view to look at it on the model, but the building appears very dark, with two small slivers of light. I'm used to the old Blender of XP days; I'm really struggling to get used to the new Blender interface. Anyways, I used to just load a texture in the UV screen and look at it in 3D in object mode, but it's not working for me. In-game, I strain my eyes trying to see AO and can't see any; even though all my graphics options are maxed out, including the Shader Effects. Could it be that my tweaking with the model removed the texture linkage somehow? Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 8, 2021 Report Share Posted February 8, 2021 3 minutes ago, DanW58 said: In-game, I strain my eyes trying to see AO and can't see any; even though all my graphics options are maxed out, including the Shader Effects. Could it be that my tweaking with the model removed the texture linkage somehow? It's hard to tell. Maybe vladislav would tell you, he seemed to be interested in you uploading the patch to Phab. I never took the time to learn GLSL :/ 4 minutes ago, DanW58 said: Stan, I found the ao png, and it looks good; but I wanted to see it on the model, so I loaded it into Blender in the UV editor, and went back to the 3D view to look at it on the model, but the building appears very dark, with two small slivers of light. I'm used to the old Blender of XP days; I'm really struggling to get used to the new Blender interface. Anyways, I used to just load a texture in the UV screen and look at it in 3D in object mode, but it's not working for me. Can you take a screenshot? I could send you a blend file with the ao applied if that helps Here is my plugin btw https://github.com/StanleySweet/blender_pyrogenesis_importer/releases/tag/1.3.6 Quote Link to comment Share on other sites More sharing options...
DanW58 Posted February 8, 2021 Report Share Posted February 8, 2021 (edited) Well, my Blender interface is now completely messed up; it became divided into four sub-screens, with the top left full of icons for folders; I don't even know what I touched; and can't seem to get out of it. Maybe you can look at the file and, yes, maybe apply the texture to it for me; I've had so much Blender frustration today I almost need medication. GLSL is much easier than it looks. First of all, it's much like C. But the main types of variables you use are float, vec3 and vec4 (3 and 4 floats, respectively). So, for a fragment shader example, uniform vec3 sunray; //uniform means that it's like a per-frame constant uniform vec3 suncolor; //ditto uniform sampler2D baseTex; //this is a data structure to read a texture varying vec2 v_tex; //texture coordinates, interpolated by vertex shader varying vec3 vnormal; //interpolated vertex normal, varying means from the vertex shader main() //this executes per pixel, or per pixel-fragment in antialiased mode { //calculate the diffuse component of final color: vec3 difftexture = texture2D(baseTex, v_tex.xy); //fetch diffuse color from texture float diffuse_intensity = dot(sunray, vnormal); //dot = cosine of angle; 1 for face-on vec3 diffuse = difftexture * suncolor * diffuse_intensity; //similar thing for ambient light with ao //similar thing for specular //add it all together and output. } //next pixel... What is that plug-in? For what? EDIT: File attached; no change since last attached. ptol_civic_centre.dae Edited February 8, 2021 by DanW58 Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 8, 2021 Report Share Posted February 8, 2021 20 minutes ago, DanW58 said: Well, my Blender interface is now completely messed up; it became divided into four sub-screens, with the top left full of icons for folders; I don't even know what I touched; and can't seem to get out of it. Maybe you can look at the file and, yes, maybe apply the texture to it for me; I've had so much Blender frustration today I almost need medication. Happens sometimes, here is a little video, and the blend ptol-cc-ao.blend importing-ao.mp4 21 minutes ago, DanW58 said: What is that plug-in? For what? importing-plugin.mp4 Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted February 8, 2021 Report Share Posted February 8, 2021 22 minutes ago, DanW58 said: uniform means that it's like a per-frame constant Per draw call constant. But some constant might be per frame. 22 minutes ago, DanW58 said: texture coordinates, interpolated by vertex shader It's not interpolated by vertex shader, because vertex shader knows nothing about fragments. It will be interpolated on or or after rasterization step. 22 minutes ago, DanW58 said: //this executes per pixel, or per pixel-fragment in antialiased mode Usually it's called per-pixel in both modes. Only some driver implementations allow you to force per-sample executing. 22 minutes ago, DanW58 said: dot(sunray, vnormal); //dot = cosine of angle; 1 for face-on Mostly, but not in that case. vnormal isn't normalized, so it'd be near but not always cosine. Quote Link to comment Share on other sites More sharing options...
DanW58 Posted February 8, 2021 Report Share Posted February 8, 2021 (edited) Stan, I can't follow; too fast. Maybe tomorrow after coffee. I mean today. So, the ao looks perfect; I just don't see it in-game, for some mysterious reason. 10 minutes ago, vladislavbelov said: Mostly, but not in that case. vnormal isn't normalized, so it'd be near but not always cosine. Yeah, now I remember it had to be normalized... EDIT: Speaking of cosines, which type of ao are you guys using? The ao by Blender is unmodulated, last time I looked into it. That means, all rays are counted equally. There's a type of ao where rays are multiplied by light dot normal before accumulating. That type of ao gives noticeably more realistic results. Edited February 8, 2021 by DanW58 Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 8, 2021 Report Share Posted February 8, 2021 Before blender 2.8 we used this Now I use a custom setup ao-as-emissive.blend Quote Link to comment Share on other sites More sharing options...
DanW58 Posted February 8, 2021 Report Share Posted February 8, 2021 Nice! Why is it called "ao_as_emissive"? AO modulates reflected ambient. I hope you guys are not ADDING the ao... It should multiply the ambient component. It should darken, not brighten... Is this why I can't see it? (Going to bed now.) Quote Link to comment Share on other sites More sharing options...
DanW58 Posted February 8, 2021 Report Share Posted February 8, 2021 I'm looking at ao code in model_common.fs... #if (USE_INSTANCING || USE_GPU_SKINNING) && USE_AO vec3 ao = texture2D(aoTex, v_tex2).rrr; ao = mix(vec3(1.0), ao * 2.0, effectSettings.w); ambColor *= ao; #endif The first line is informative. The last line is reassuring. But the middle-line makes me reach for the gyn bottle ... ao * 2.0 ?!?!?!? Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted February 8, 2021 Report Share Posted February 8, 2021 22 minutes ago, DanW58 said: It should multiply the ambient component. I suppose it contradicts to your patch for the current game. Because you decrease ambient from skies for vertical surfaces. But AO is used for any kind of indirect light, including sun direct light reflected from some surfaces, which is more powerful than skies ambient. Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted February 8, 2021 Report Share Posted February 8, 2021 2 minutes ago, DanW58 said: But the middle-line makes me reach for the gyn bottle ... ao * 2.0 ?!?!?!? It happens in our code, and usually it's just a workaround to make it look better. You haven't seen the water one before I've done a cleanup for it. Quote Link to comment Share on other sites More sharing options...
DanW58 Posted February 8, 2021 Report Share Posted February 8, 2021 (edited) There are no other sources for ao to modulate; ambient is it; ambient accounts for all sources except direct. Given the entire luminous surroundings, environment mapping returns the specular portion of it, and reflected ambient returns the diffuse portion of it. And just like reflections should get some self-occultation but that's really difficult to do, reflected ambient can get occultation by modulating it by the ao. It just has to be multiplied by the ao. 13 minutes ago, vladislavbelov said: But AO is used for any kind of indirect light, including sun direct light reflected from some surfaces, which is more powerful than skies ambient. You're talking about second reflections; that's a whole other subject; it cannot be handled by ao nor by anything except a HUGE hack; I tried to tackle that one... 11 minutes ago, vladislavbelov said: It happens in our code, and usually it's just a workaround to make it look better. You haven't seen the water one before I've done a cleanup for it. Thing is, not only is it incorrect, but it is likely to cause saturation. The good news is I took out that "* 2.0" and nothing changed... Maybe it's something with my videocard? Can't seem to see the ao in-game. Edited February 8, 2021 by DanW58 Quote Link to comment Share on other sites More sharing options...
DanW58 Posted February 8, 2021 Report Share Posted February 8, 2021 I've just tried removing any graphical features not necessary to ao, to see if my videocard was overwhelmed, but it makes no difference; still no ao. Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 8, 2021 Report Share Posted February 8, 2021 1 hour ago, DanW58 said: Nice! Why is it called "ao_as_emissive"? AO modulates reflected ambient. (Going to bed now.) I don't know why it added your images to my post, and won't let me delete them. Because I use blender emissive channel to bake it without interference from other stuff. This way I'm sure whatever I bake is pure AO, not stuff with reflections and whatnot. EDIT: Goodnight Quote I hope you guys are not ADDING the ao... It should multiply the ambient component. It should darken, not brighten... Is this why I can't see it? It's multiplied in the game. https://trac.wildfiregames.com/wiki/MaterialSystem & https://trac.wildfiregames.com/wiki/MaterialFormat EDIT: Just saw your above post. 15 minutes ago, DanW58 said: I've just tried removing any graphical features not necessary to ao, to see if my videocard was overwhelmed, but it makes no difference; still no ao. One thing you can try is to replace the ptol struct by a white texture https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/art/textures/skins/structural/ptol_struct.png Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.