How to add normals for buildings? #1288

Open
opened 3 years ago by jiangqi9090 · 3 comments
jiangqi9090 commented 3 years ago (Migrated from github.com)

I'm working on dynamic lighting but only player and vehicle models have normals in vertex input.

I'm working on dynamic lighting but only player and vehicle models have normals in vertex input.
Rider66code commented 3 years ago (Migrated from github.com)
  1. You need models adapted for that, so normals would be calculated. Reexport using ZMod will do the trick.
  2. You need to comment out DeActivateDirectional(); in the code.

That way you'll make directional lightning work on buildings/roads/etc. on standard renderer. However, I'm not yet figured out how to make it work with new renderer yet, possibly somebody else might have idea.

1. You need models adapted for that, so normals would be calculated. Reexport using ZMod will do the trick. 2. You need to comment out DeActivateDirectional(); in the code. That way you'll make directional lightning work on buildings/roads/etc. on standard renderer. However, I'm not yet figured out how to make it work with new renderer yet, possibly somebody else might have idea.
jiangqi9090 commented 3 years ago (Migrated from github.com)
  1. You need models adapted for that, so normals would be calculated. Reexport using ZMod will do the trick.
  2. You need to comment out DeActivateDirectional(); in the code.

That way you'll make directional lightning work on buildings/roads/etc. on standard renderer. However, I'm not yet figured out how to make it work with new renderer yet, possibly somebody else might have idea.

Is there a automatic way to convert the models?
And do you know how to read depth buffer in pixel shader? I want to add ssao and some other post effects.
Thanks.

> 1. You need models adapted for that, so normals would be calculated. Reexport using ZMod will do the trick. > 2. You need to comment out DeActivateDirectional(); in the code. > > That way you'll make directional lightning work on buildings/roads/etc. on standard renderer. However, I'm not yet figured out how to make it work with new renderer yet, possibly somebody else might have idea. Is there a automatic way to convert the models? And do you know how to read depth buffer in pixel shader? I want to add ssao and some other post effects. Thanks.
petrgeorgievsky commented 3 years ago (Migrated from github.com)

Models without normals in GTA games have wrong index order most of the times, and if you auto-generate normals for them in traditional way it'll result in flipped normals. As for reading from depth buffer you'll need to copy it from camera zBuffer somehow, or use your own rendertarget as depth buffer.

Models without normals in GTA games have wrong index order most of the times, and if you auto-generate normals for them in traditional way it'll result in flipped normals. As for reading from depth buffer you'll need to copy it from camera zBuffer somehow, or use your own rendertarget as depth buffer.
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mirror/re3#1288
Loading…
There is no content yet.