Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Nymphodora, Quad), 919 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
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
Support me on: https://boosty.to/3rung
Re: StandardShader [Re: 3run] #479136
02/21/20 16:31
02/21/20 16:31
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
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,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
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
Support me on: https://boosty.to/3rung
Re: StandardShader [Re: 3run] #479138
02/21/20 20:33
02/21/20 20:33
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
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,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
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
Support me on: https://boosty.to/3rung
Re: StandardShader [Re: 3run] #479140
02/21/20 22:00
02/21/20 22:00
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
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