Jump to content

Offline Light Propagation Volumes


andrewmac

Recommended Posts

  • 4 weeks later...
  • Replies 67
  • Created
  • Last Reply

Top Posters In This Topic

Just curious has anyone ported this to deffered lighting (default per pixel) successfully yet?

I played with it in deffered shading and I feel it would be a great addition to the main repo, granted anyone being successfully at the port..

Link to comment
Share on other sites

Yeah the branch is based in deferred shading, so if you compile it from or port to a project default its set to deferred shading. I've been trying to get it working in the default per pixel lighting but been running into issues..Everything compiles ok but crashes whenever I load a mission. Andrew said it should work in per pixel but I'm having a hardtime tracking down all the stuff I need and then changing the areas that are written for deferred shading and change it back to per pixel..If anyone has successfully done this please help me out, been wrestling with it for a few days..

Link to comment
Share on other sites

If im not mistaken I believe it per pixel.. At least up to 3.6...I had a few custom shaders done and I was told it was per pixel. I know andrew and azarael completed a verison of the engine based on shading but to my knowledge I dont think the main branch did.

Link to comment
Share on other sites

@lukasPJ: Afraid not. Opengl, Linux, and Mac support are taking too long for review to add more to the pile for 3.7, so the deferred lighting stage was put off till 3.8 (not sure where the second stage'll fit in given the backwards compatibility breaks for sanity's sake. probably 4.0)


@jay1ne: deferred shading does not require the material per-pixel flag because it is using a per-pixel lighting buffer as an inherent part of the process, and shifts that calculation out of the per-material shaders and into the general-use lighting ones. LPV leverages that additional buffer.


Does that clarify things?

Link to comment
Share on other sites

Deferred lighting and shading (and even forward) are all per-pixel lighting techniques so I don't know why anyone is throwing around that term.


Offline LPV just renders into the lighting buffer that's used in both deferred lighting and shading, there's no reason Offline LPV wouldn't work in deferred lighting.

Link to comment
Share on other sites

Azaezel, Yep pretty much summed it up! Andrew, I understand they are all part of the per pixel technique they are all different type of render at least to my understanding. As you said offline isn't just limited too shading. My issue is that I'm having a hard time tracking down all the change made to have it working in the default (since you don't like the term deferred ) lighting.

Honestly if it's working and working right there shouldn't be any reason why it shouldn't be added to the main repo..IJS


That why I was attempt to get it working in the default lighting so people can pick their poison..Some may prefer shading and other lighting this way a person can pick what they are more familiar with.


I feel somewhat comfortable working in code now but if I can be given a list or something to help me see all the changes then it would help me figure out what I did wrong.


As I mentioned I have it compiling but it crashes upon load any level..The breakpoint or crash points to \source\materials\matinstance.cpp(521,0): {Fatal} - Not init'ed!

and another points to shaders/common/lighting/advanced/vectorLightP.hlsl(263,11): error X3013: 'autogenCondition_bde4cbab': function does not take 6 parameters

Failed to initialize material 'AL_VectorLightMaterial'


When I took a look at the line the last one pointed to. I think it was pointing to the return AL_DeferredOutput(lightColorOut, colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);


I took a look at the original vector code and that wasn't in there..So it make me think is this for deferred shading, If so what would I need to put in to get it back to lighting? if anyone could help me out it would be great!

Link to comment
Share on other sites

As I mentioned I have it compiling but it crashes upon load any level..The breakpoint or crash points to \source\materials\matinstance.cpp(521,0): {Fatal} - Not init'ed!

and another points to shaders/common/lighting/advanced/vectorLightP.hlsl(263,11): error X3013: 'autogenCondition_bde4cbab': function does not take 6 parameters

Failed to initialize material 'AL_VectorLightMaterial'

 

Vector lights weren't changed for offlineLPV. You're porting changes from deferred shading into deferred lighting. You're going outside of the scope of the changes for OfflineLPV. Honestly dude, maybe you should just wait for Az or someone else to do it. You can't just blindly copy files from A to B and hope it works in this case. You have to analyze what's been changed and do a proper port (hence the term porting).

Link to comment
Share on other sites

I just went to the offline branch and copied the changes that were done to the branch..Thats why I asked wh!at where the changes made and I would go to the author because I figures you would know exactly what was changed and if someone has issues you should be able to assist on how to install.

I asked you a number a times what where ALL the changes made. For example when most ppl post resources and explain it step by step on how to add something. Not everyone has the same knowledge base in programming as I told you I'm more of an artist but I have a little knowledge of programming but obviously not where you are. A good explanation can go a long way.

Anyways I'll restart my test and see where that ends me up to. Maybe I did copy something that was for the shading pipeline but as I said a good explanation of the altered files would help..Even for us dummies!!!

Edited by jay1ne
Link to comment
Share on other sites

I know it wasn't a resource my point was in an attempt at porting something and have questions about something go to the author of the code..but that's fine if you have no interest on porting your own code. Hopefully somebody will be willing to help me out..It really would be a neat feature to add to the list of list things out the box in T3D..Ijs


Anyone feel the sameway send me a message, the more heads on this the better..

Link to comment
Share on other sites

As I mentioned I have it compiling but it crashes upon load any level..The breakpoint or crash points to \source\materials\matinstance.cpp(521,0): {Fatal} - Not init'ed!

and another points to shaders/common/lighting/advanced/vectorLightP.hlsl(263,11): error X3013: 'autogenCondition_bde4cbab': function does not take 6 parameters

Failed to initialize material 'AL_VectorLightMaterial'


When I took a look at the line the last one pointed to. I think it was pointing to the return AL_DeferredOutput(lightColorOut, colorSample.rgb, matInfo, addToResult, specular, Sat_NL_Att);

 

Looks like you snagged the one from pbr, if youre using AL_DeferredOutput, general direction would be something along the lines of...


A) {Fatal} - Not init'ed! is typically shadergen related and crops up when it goes looking for a previouisly defined variable and it's blank. (or has one and theres no application tie-in. can never remmber which)

B) vectorlightP.hlsl likewise was rewritten, with that AL_DeferredOutput being the per-pixel equivalent we'd discussed, and the other new method being the generalized cook-torrence, so you'll need to roll those portions back.

C) you'll want the older reflect one from https://github.com/andr3wmac/Torque3D/blob/offlineLPV/Templates/Full/game/shaders/common/offlineLPVReflectP.hlsl and you'll need drop the matInfoSample metalness lookup off the side.

Link to comment
Share on other sites

  • 1 year later...
Now that we have dx11 is this going to happen ?

 

The only reason I made this is because the DX9 limitation prevented light propagation volumes from being efficiently implemented in realtime. If DX9 support is dropped and DX11 is the norm someone should rewrite the injection and propagation steps to use compute shaders and you'll have realtime light propagation volumes instead of baked.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...