Tomb Raider Forums

Tomb Raider Forums (https://www.tombraiderforums.com/index.php)
-   XNALara (https://www.tombraiderforums.com/forumdisplay.php?f=52)
-   -   Real Bumpmapping for XNALara (https://www.tombraiderforums.com/showthread.php?t=194074)

Cochrane 10-09-12 18:35

Real Bumpmapping for XNALara
 
First of all, the important stuff:
[SIZE="6"][COLOR="Blue"]DOWNLOAD Link EffectsArmature.xnb[/COLOR] [color=red]v2[/color]
[url]https://github.com/downloads/cochrane/xnalara-shaders/EffectsArmature.xnb[/url]
Copy this file into the folder XPS_10.8.7\Content or XNALara\Content[/SIZE]
Test Model: [url]http://www.sendspace.com/file/uefyao[/url]
Git repository with source code: [url]https://github.com/cochrane/xnalara-shaders[/url]

------------

As you may know, I'm currently working on an XNALara program for Mac, and I've had a lot of help and support from the existing XNALara community, who will never be able to use my program unless they buy a new computer just for it. So partly because of that and partly because I was bored, I wanted to give something back. Specifically, working bump maps.

This file contains (almost) all the shaders used by XNALara. I have modified them to use a different (and hopefully better) way of calculating light based on bump maps. The way this is currently done in XNALara is very peculiar, and among other things, doesn't take the light direction into account except for highlights (aka specular lighting). What I've done now is a very standard way of doing normal mapping, which uses the normal map for all light calculations directly. In terms of performance, it should be about the same (in fact, my version will be slightly faster because it does less work, but only so little that you have no chance of ever noticing it). All the rest of the shading remains as it was.

This was the job of about an hour's hacking, and I haven't actually looked at the result yet – I've just had other people tell me that it works. So ideally, save the old file somewhere, try this out, and see whether you like it. If you have problems, tell me, and I'll try to fix them as soon as possible.

------------

[b]Known bugs:[/b] All fixed in the latest version, hopefully.

Former bugs:[list][*]Render groups 24 and 25 use mini bumpmaps even though they shouldn't, leading to potentially very odd results.[*]Incorrect default normals are returned for groups 1, 20, 22, 23 (and also 24 and 25, but they should get different ones anyway) when bump mapping is disabled.[*]Detail bump maps are not applied for render group 28 and 29.[/list]
[b]Might look like a bug but isn't:[/b] I'm not sure where you set the BumpShadowAmount value, but it will not do anything anymore now. This is intentional; that feature doesn't make a lot of sense given the way bump maps are implemented now. However, instead, the shadow depth value will now apply to bumped features, too.

All these modifications are in the public domain (but not the original file; that's copyright Dusan, although he has made it open source). So if Dusan wants to include this in the next XNALara, or if you want to include this in your own XNALara fork, have fun!

Special thanks go to XNAaraL, for compiling the file, helping fix some compile errors and informing me of the issue with the bump maps to begin with. Thank you! :) (I've now put it all on github, because it's open source, and because I think sendspace has too many ads. The original link is at [url]http://www.sendspace.com/file/zz8lkc[/url] ).

KamilM_93 10-09-12 18:46

I tested this on Viola from Soul Calibur 5.

And works perfect! Thanks!

TRDaz 10-09-12 18:50

I dont see the difference in mine D:

NRO. 10-09-12 18:55

Can we have some pictures? ^_^

KamilM_93 10-09-12 18:55

[QUOTE=TRDaz;6427656]I dont see the difference in mine D:[/QUOTE]

It works the best on Soul Calibur and Tekken models ^.^

TRDaz 10-09-12 18:56

[QUOTE=KamilM_93;6427672]It works the best on Soul Calibur and Tekken models ^.^[/QUOTE]
Ill test ^^

EDIT: Oh my... It looks amazing! Especially on SCV Viola and Ivy 2P! :D Thanks :D

o0Crofty0o 10-09-12 19:11

Well... it trashed kinda all models using group 24 or 25 for me (and no i WON'T use 22_ or 23_...don't see a reason to add senselessy many maps in case someone wants to recommend that to me >.<)
Here are some pics:
[URL="http://i618.photobucket.com/albums/tt270/o0Crofty0o/bug2.jpg?t=1347304165"]http://i618.photobucket.com/albums/tt270/o0Crofty0o/bug2.jpg?t=1347304165[/URL]
[URL="http://i618.photobucket.com/albums/tt270/o0Crofty0o/ssdsd.jpg?t=1347304187"]http://i618.photobucket.com/albums/tt270/o0Crofty0o/ssdsd.jpg?t=1347304187[/URL]
[URL="http://i618.photobucket.com/albums/tt270/o0Crofty0o/sdsdsd-4.jpg?t=1347304165"]http://i618.photobucket.com/albums/tt270/o0Crofty0o/sdsdsd-4.jpg?t=1347304165[/URL]

Looks like they got overlayed with some sort of mini bump that isn't even on the model^^

Cochrane 10-09-12 19:18

[QUOTE=o0Crofty0o;6427723]Well... it trashed kinda all models using group 24 or 25 for me (and no i WON'T use 22_ or 23_...don't see a reason to add senselessy many maps in case someone wants to recommend that to me >.<)
Here are some pics:
[URL="http://i618.photobucket.com/albums/tt270/o0Crofty0o/bug2.jpg?t=1347304165"]http://i618.photobucket.com/albums/tt270/o0Crofty0o/bug2.jpg?t=1347304165[/URL]
[URL="http://i618.photobucket.com/albums/tt270/o0Crofty0o/ssdsd.jpg?t=1347304187"]http://i618.photobucket.com/albums/tt270/o0Crofty0o/ssdsd.jpg?t=1347304187[/URL]
[URL="http://i618.photobucket.com/albums/tt270/o0Crofty0o/sdsdsd-4.jpg?t=1347304165"]http://i618.photobucket.com/albums/tt270/o0Crofty0o/sdsdsd-4.jpg?t=1347304165[/URL]

Looks like they got overlayed with some sort of mini bump that isn't even on the model^^[/QUOTE]

Okay, 24 and 25, that's DiffuseLightmapBumpSpecular. I'll look into it, thank you for the bug report!

Edit to add: You're completely right, that was the problem. I've copied and pasted a bit too much, and accidentally used the mini bumpmap function in that shader when I should have just used the single one.

You didn't set the mini bumpmaps, but if any part of the model uses mini bumpmaps, then these mini bumpmaps will be used for all meshes that are rendered later - right until the next time a mini bumpmap is set. The shader normally simply ignores them.

I've uploaded a new version of the source code that fixes the issue at the original address (search for your user name if you want to know where exactly. :D). Now we just have to wait until someone has the time to compile this and uploads a new version, because I can't do that on my Mac, and I have no idea how it's done on Windows.

KamilM_93 10-09-12 19:18

24_ and 25_ render groups are totally buggy. XNAaral said this a long time ago!

o0Crofty0o 10-09-12 19:18

[QUOTE=Cochrane;6427744]24 and 25, that's DiffuseLightmapBumpSpecular. I'll look into it, thank you for the bug report![/QUOTE]

Yepp^^
the weird thing is that it works fine on some models and on others not >.<

[QUOTE=KamilM_93;6427748]24_ and 25_ render groups are totally buggy. XNAaral said this a long time ago![/QUOTE]


The only ''bug' i saw was that the ''enable bump maps'' button didn't work.. and well noone complained about any bugs on my models so :rolleyes:


All times are GMT. The time now is 13:27.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Tomb Raider Forums is not owned or operated by CDE Entertainment Ltd.
Lara Croft and Tomb Raider are trademarks of CDE Entertainment Ltd.