You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I obviously have no clue what discussions you people had so take this with a grain of salt:
I think first step for shadows should be to to shift all D3D render target objects to a separate RenderTarget class. If you add them directly to RenderingDevice you'll need to spray it with a lot of if...else block to enable/disable shadows. Also adding such conditionals is against the objective of RenderingDevice which is supposed to be a dumb class that just interfaces with the D3D API. What I think would be nice is to have a function in RenderingDevice that returns a tuple of ID3D11DepthStencilView, ID3D11ShaderResourceView and ID3D11RenderTargetView and that hypothetical RenderTarget class takes ownership of it.
Now CameraComponent will own a RenderTarget in case of no shadows or 2 RenderTarget in case of shadows. An even better part is that you can get a "render to texture feature" for free, just by making the ID3D11RenderTargetView point to a texture instead of screen. Another good thing that could come out of such a design is that only CameraComponent needs to know if shadows are enabled or not and it could take control of the final draw() call. Hence it could call draw once after binding the shadow ID3D11RenderTargetView. Then again after binding the shadow and ID3D11RenderTargetView, Which fits in nicely since there is where little difference between the configuration of a shadow buffer render and final render.
I had these thoughts long back when we were thinking of adding shadows but my memory is hazy and I may have written things that don't make sense anymore. Also this task of "architecting" could be taken up by some 3y probably :p.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.