Gamestudio Links
Zorro Links
Newest Posts
Indicator coding
by danatrader. 06/07/20 05:45
Chat Room for Zorro Programmers
by danatrader. 06/07/20 05:27
Applying indicators to multiple currency pairs
by danatrader. 06/07/20 05:25
Reading a TXT file on server
by Truth. 06/06/20 23:28
Zorro S for Oanda US
by SteveG. 06/06/20 21:37
The Black Book
by danatrader. 06/06/20 18:31
New AUM
by Aku_Aku. 06/06/20 10:10
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
4 registered members (danatrader, Grat, kvm, Dooley), 448 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Frank_Shieh, PBSeven, Hardi01, Giuseppe, AdamWu
18461 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
StandardShader #479054
02/10/20 20:54
02/10/20 20:54
Joined: May 2009
Posts: 5,265
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,265
Caucasus
There is this awesome StandardShader for Acknex made by MasterQ32. It's HLSL Reimplementation of the Gamestudio Default Shading. With normal maps and per pixel lighting.
But there is an issue in it:
Quote
std_lightmapped is not yet right
std_normalmapped_lightmapped is not yet right
Maybe some shader gurus could fork (+pull request) and finish it? This could be super handy to use instead of outdated standard shaders.

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Re: StandardShader [Re: 3run] #479136
02/21/20 16:31
02/21/20 16:31
Joined: Jun 2007
Posts: 1,322
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,322
Hiporope and its pain
Hi,
I gived a try to this and had tons of troubles. I forked it and uploaded my attempt here.

The main trouble is that the 'vecLight' vector has completely different values for blocks and entities. 'vecLight' is the only reference to PVR and overall ambient value so its usage is a must in order to get 'camera.ambient' implemented, but it happens that it has very strange values on blocks. After hundreds of tries and samples I arrived to undertand that blocks receive a 'vecLight' vector as follows:
Code
amb_factor = camera.ambient + ent.ambient + ...;
amb_average = (ambient.r + ambient.g + ambient.b) / 3;
vecLight.r = (ambient.r + amb_factor + 128 - amb_average) / 255;
vecLight.g = so on...

Pretty weird, isn't it? The only solution I can think on is to compute the inverse operation in order to get the 'amb_factor' value and aplly it in the lightmap. Works but wtf?

Once I solved this issue I tried to equalize the 'vecLight' passed to entities so it results in a similar colors of blocks but I have been unable.

It happens that terrains always receive 'vecLight' with the ambient value only, as far as I tested.

I also realized that sky blocks are rendered with 'mtl_sprite' material instead of 'mtl_sky'. I have been unable to make a samplerCUBE work over block sky textures so I could not overwrite the material.

At the end it works pretty well but far from the engines render output. Maybe someone want to give a try...

Salud!

Re: StandardShader [Re: 3run] #479137
02/21/20 19:40
02/21/20 19:40
Joined: May 2009
Posts: 5,265
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,265
Caucasus
Man, it looks so awesome! laugh You are the shader master!

BTW, demo is missing two skins (used by box.mdl) test.tga and test_n.tga. I think it would be awesome if you make pull request to merge your version with the original one! :>

My best regards! Heil to the shader king!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Re: StandardShader [Re: 3run] #479138
02/21/20 20:33
02/21/20 20:33
Joined: Jun 2007
Posts: 1,322
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,322
Hiporope and its pain
hey! thank you, man grin

Just uplodaded the missing textures. I need to search for shareable models, textures and normalmaps. I suspect I am breaking the licenses of the ones I used xP

Re: StandardShader [Re: 3run] #479139
02/21/20 20:39
02/21/20 20:39
Joined: May 2009
Posts: 5,265
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,265
Caucasus
Hehe, maybe you can find something in this models (I'll look for some models+textures too)
Free models from FPSC

Edit: I guess I've found something useful! Will send them to you via PM.

Last edited by 3run; 02/21/20 20:46.

Looking for free stuff?? Take a look here: http://badcom.at.ua
Re: StandardShader [Re: 3run] #479140
02/21/20 22:00
02/21/20 22:00
Joined: Jun 2007
Posts: 1,322
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,322
Hiporope and its pain
Received!

Thank you again wink


Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1