Jump to content

[HELP]Light and shadow mapping with shader


Recommended Posts

What resource is the second one? with some work those so called "bugs" could likely be fixed.

Also one thing I can think of, of how to do something like this would be something like a reverse green screen effect, in other words


Pretty much you render the object with a different color view point behind it, using a matrix from the camera to the object, after that you use some sort of shader to drop the green background, and then you tint it black; then render that on the surrounding objects with the right set up. This is likely a very bad example; because it'd require each object to have a view point, and massive lag would occur, and it wouldn't be pretty. Just something I thought of off the top of my head, something similar but way less laggy could probably be done through a fx file and all you'd need to do is supply cords, but I haven't any experience with fx.

Edited by CodyJ(L)
Link to comment

I've made the second resource about 2 years ago. Way before MRT in shaders option was introduced. The whole purpose was to check if things were possible. That one required 1 frame to get scene depth (haven't used a proper orthographic projection matrix yet) and another to draw the outcome. The resolution is low proportionally to screen resolution and shadow range. Right now there are more possibilities. I'll try to release something decent in the near future.

Link to comment

The issue that will remain is object culling. It might be seen in cam2rt resource (mirror effect) when objects off screen disappear when certain distance is met (sa:render has this issue as well). MTA:Eir was supposed to  have custom cameras, this could solve most of the problems.

Edited by Ren_712
Link to comment

The object culling would cause shadows to suddenly appear/disappear as soon as objects are rendered / no more rendered by GTA, however maybe there is a way to prevent the shadows from just disappearing and fade them softly out as soon as the parent object is no longer on Screen...

This mod has some .fx files and an .asi file to bring the enhanced Android/IOS shadows to the PC version. So it would be theoretically possible to implement this natively in MTA.


Link to comment

the gtasa shadows are a whole different thing. What i meant (and what is seen in the first video posted by Grozz) is shadowmapping. You even see 1 frame lag - fixable if you take changes in cameraPosition into the account. So the limit adjuster has nothing to do with it.


It is fairly possible to implement that. Even shadow blurring.


Edited by Ren_712
Link to comment

SA has shadow cols; which is how it generates its shadows by default but they are often in accurate; and present a lot of issues if used on bigger objects (Rockstar were being absolutely -well, stupid as hell with their implementation of these, or in other words, shadow cols are a smart way of doing it, but they weren't thinking right when they actually added  them.)


(Also Ren, if you could implement these properly without alot lag that'd be awesome)

Edited by CodyJ(L)
Link to comment
On 28.1.2017 at 20:42, Ren_712 said:

...So the limit adjuster has nothing to do with it....

I know, i just wanted to say that the implementation would be similar to the limit adjuster:
The MTA team would have to implement mods like SA Shadow extender or SA:Render natively.
BTW Shadow cols seem to bug sometimes, however it could be a 3ds max export issue for me... Currently the best way for me is to ignore shadows at all.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...