Open valina354 opened 3 days ago
@TheOverfloater
i notice when entering dlight area this stops triggering inside of BindTextures everything else too most likely causing the issue
when outside of dlight only bindtextures runs, and when inside dlight only drawfirst runs, i dont get what im doing wrong, im doing exact same as mt_tx_luminance
it also occurs for mt_tx_ao i added
this is my entire r_bsp.cpp to btw https://pastebin.com/gmPaQQtE
I'm afraid I can't really help here unless I were there to debug the code myself. Basically you need to use the debugger yourself to see why it doesn't trigger to begin with, it means you could be trying to use the wrong material, or that particular texture unit itself is being set to null for some reason. VS2022 allows you to set a breakpoint that triggers when a value in memory is changed, it is called a Data Breakpoint.
i notice same thing occurs with mt_tx_luminance but in luminance it doesnt break it which is strange and it also cant be shader related because same thing occurs with ao which is well very simple just multiply by binded ao map so very strange
i figured out i need to also blind in drawlights however it seems to cause another issue, for some reason it seems only normal and specular gets displaced, not maintexture while without dlight it renders fine very strange
it seems that for some reason when doing dlight it doesnt bind maintexture but even manually binding it doesnt fix
i now tested with default luminance and even that is broken, doesnt work correctly in dlight area, i wonder if i somehow broke some code in r_bsp.cpp that is causing it its like hardest thing to debug
i love this engine a lot but the way rendering system is done is just so confusing in my opinion, like theres drawfirst,drawfinal,draw lights, and probably other places where you bind textueres, binding textures is literall more complex then the shaders themself, like in most other engines you just bind the textures in 1 function and thats it
i guess my only way is to try and copy paste how MT_TX_NORMALMAP binds textures and hope it works but i dont even know if that will work
i tried repeating similar to MT_TX_NORMALMAP but unless i did it wrong it stll happens, it basiclly seems to pretty much paste the same ao map on another unrelated textures and i cant tell why
btw if you want to check it out yourself the issue engine is here https://github.com/Soft-Sprint-Studios/Matrix-Engine
for vbm i literally just did this in drawmesh and it worked for both dlights and normal lights while bsp is lot of stuff
ok, so the only thing i can think of is that determinators are past 4096, basiclly i raised the limit to 8192 in C++, im not sure if that could be like causing it? has it been tested if more then 4096 determinators can work at same time? because with the ao and parallax i reached 7000 determinators @TheOverfloater
i also didnt add r_checkshaderuniform to all of them but i dont think thats issue
ok, so the only thing i can think of is that determinators are past 4096, basiclly i raised the limit to 8192 in C++, im not sure if that could be like causing it? has it been tested if more then 4096 determinators can work at same time? because with the ao and parallax i reached 7000 determinators @TheOverfloater
i removed screen space normals termporarily to get it down below 4096 but that didnt fix it so its not issue that
omg ok, so i added ao and parallax here and it seemed to fix it! ao fully works fine without bleeding into others, however
however parallax breaks with a dlight, this no dlight
and this with dlight
i think dlights how they render somehow coincide with parallax or somehow break it i need to test more however
ye its caused by the weird strange bug from before with for some reason on dlight only showing parallax on normalmap i dont understand how i would fix it
Without seeing the shader code, and the BSP Renderer changes I cannot really tell what is wrong, but I assume you would need to account for parallax mapping both when rendering the first pass(lightmaps only), then account for it with each individual dynamic light, and finally account for it again in the third pass(rendering the texture, then rendering specular highlights, cubemaps). Make sure you have these stages also account for the parallax mapping, otherwise yes, it will break.
i seriously dont know what to do, i added to drawfinal as its final place to bind shaders that wasnt there and yet it still didnt fix it, this is my r_bsp.cpp https://github.com/Soft-Sprint-Studios/Matrix-Engine/blob/main/matrix/sources/codesrc/engine/renderer/r_bsp.cpp and this is the shader https://github.com/Soft-Sprint-Studios/Matrix-Engine/blob/main/matrix/scripts/shaders/bsprenderer.bss if you like have any free time to check it out because tbh i dont know myself i have been checking for last few days and cant figure it out
i added parallax occlusion mapping to engine but i got issue which is that for some reason when dlights are on the texture binding itself breaks or something and bleeds into other ones i added this
and this
![image](https://github.com/TheOverfloater/pathos-public/assets/80889633/01f519c3-74af-49b2-b067-9de41b86385d)
below if(pmaterial->ptextures[MT_TX_LUMINANCE]) {
functions, in area with no dlight it looks fine like this![image](https://github.com/TheOverfloater/pathos-public/assets/80889633/7bba2b78-07ea-4d0f-a24a-ee884fbbed08)
but in area with dlight it breaks![image](https://github.com/TheOverfloater/pathos-public/assets/80889633/1f8d16b3-7124-4857-be08-7317eb2914b9)
without height texture being defined this doesnt happen, so i think im binding in wrong places