ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Cube maps in STALKER

1 2 3 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Oldest Up Sort by Ascending
  20:53:57  9 August 2013
profilee-mailreply Message URLTo the Top
Jketiynu
Swartz
(Resident)

 

 
On forum: 04/05/2007
 

Message edited by:
Jketiynu
08/10/2013 7:15:44
Messages: 867
*bump*
Edited at bottom of post

Sorry for bumping such an old thread, but I've been experimenting with this over the past two days and think I'm finally getting somewhere.

Before no matter what I tried to use for models_weapons.s it would be either transparent or some other glitch would occur.

Now I can get it to appear in the normal place, with one of them looking the way it should look (sorta, I'll explain).

Method 1: http://pastebin.com/CXgHwHxW
The model reacts to light and appears correctly, but it's very dark.

Method 2: http://pastebin.com/ELqVWg7C
This version as far as I can tell looks identical to the vanilla version, however there is a graphical glitch in the sky with it enabled.

I obviously don't understand shaders that well so it's probably some simple mistake I made that can be fixed and then models_weapons can finally be modified.

I also sent an email about this to team Dezowave as they've been helpful to me in the past so hopefully they'll help again.

Just posted this since I'd love a better lighting model and reflection map for weapons, but first we need to figure out how models_weapons is handled internally to begin with.

*EDIT*

Got it working finally.
http://imgur.com/k8ZDpqP

In the screenshot the hands and AK74 uses the new weapon shader, the hands are using vanilla (renamed the weapon shader for the ak to models_weapon5 by hex-editing and created corresponding models_weapon5.s file)
Here's the models_weapons.s file used: http://pastebin.com/bEWLTdAV

Some notes:
1) I don't think it uses a bump map (yet, I need to find a better example to see if it gets read. If it doesn't it shouldn't be hard to fix I imagine)
2) The reason I was getting either the glitch in the sky before or a dark model is because I used the VS shader for accum_volumetric which causes problems.
It looks like the first part of the shader line corresponds to the VS, and the 2nd is PS. I set VS to null and thus it came out correctly.
3) The lighting and shadowing on the model is identical to vanilla weapon shader

Now to improve on it by adding a cubemap, maybe writing a custom lighting file for it instead of using accum_volumetric, etc.

Since I was nice enough to share, if anyone including myself creates some neat results lets share it/keep it open source guys.
  10:15:47  27 March 2013
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
 

Message edited by:
Meltac
03/27/2013 10:17:03
Messages: 1519

---QUOTATION---
I also now realize my dream of having a reflection or refraction shader for scope lenses isn't realistic. Oh well
---END QUOTATION---



Hmm, I'm not entirely sure about that. The scope lenses show some (faked) reflection already in vanilla, which is different from the rest of the weapon. That might mean that the lens has been assigned a different shader by default. Although I don't know what shader file that would be. Maybe xlens.s?


---QUOTATION---
Too bad it's that hard and convoluted, would have been amazing to get it working.
---END QUOTATION---



What I said before is my current understanding of how those files play together. However, as stated initially, I'm not a pro on that front, so there's still a chance that there's some easier way to do it. The question is, though, who has the knowledge to unveil the way - and is willing to share it.
  05:15:50  27 March 2013
profilee-mailreply Message URLTo the Top
Millenia
(Senior)
 
On forum: 04/04/2007
Messages: 130
Too bad it's that hard and convoluted, would have been amazing to get it working

Thanks for looking into it, Meltac.
  19:28:40  26 March 2013
profilee-mailreply Message URLTo the Top
Jketiynu
Swartz
(Resident)

 

 
On forum: 04/05/2007
Messages: 867

---QUOTATION---
Anyways, are we sure we'd need to specify bumpmap and all that kinda crap in the .s file? I'm pretty sure stuff like that gets loaded automatically as long as it exists.
I'm new to all this, but it would seem to me that you simply need to start by finding a more neutral .s file as a base and removing transparency.

I don't know for sure, but doesn't "aref" control transparency? Maybe removing that from the .s file would help.

I've checked that. Try copying different existing .s files and renaming them to "models_weapons.s" and see what happens. The transparency is NOT the issue! It just came from having assigned the wrong shader files in the .s files.

That's the problem: You have to assign a specific shader file within the .s file, regardless of the rest of the settings there. What means that the engine (aka X-Ray) calls that specific shader for the task of rendering (or better, shading) the object in question (in our case, a weapon model). Doing so breaks the entire rendering pipeline as X-Ray just promotes all the shading work to one single shader, instead of processing a chain of subsequent shader calls as it's the case without using the .s file. It's a replacement of the normal rendering we do here.

That means, as soon as you have a .s file for something you are responsible yourself that all the rendering/shading stuff is done properly (by writing a shader doing so). Doable, but pretty some handwork.
---END QUOTATION---



I see, I think I get it now. Thank you for explaining it.

I also now realize my dream of having a reflection or refraction shader for scope lenses isn't realistic. Oh well
  13:27:00  26 March 2013
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
 

Message edited by:
Meltac
03/26/2013 13:28:22
Messages: 1519

---QUOTATION---
Anyways, are we sure we'd need to specify bumpmap and all that kinda crap in the .s file? I'm pretty sure stuff like that gets loaded automatically as long as it exists.
I'm new to all this, but it would seem to me that you simply need to start by finding a more neutral .s file as a base and removing transparency.

I don't know for sure, but doesn't "aref" control transparency? Maybe removing that from the .s file would help.
---END QUOTATION---



I've checked that. Try copying different existing .s files and renaming them to "models_weapons.s" and see what happens. The transparency is NOT the issue! It just came from having assigned the wrong shader files in the .s files.

That's the problem: You have to assign a specific shader file within the .s file, regardless of the rest of the settings there. What means that the engine (aka X-Ray) calls that specific shader for the task of rendering (or better, shading) the object in question (in our case, a weapon model). Doing so breaks the entire rendering pipeline as X-Ray just promotes all the shading work to one single shader, instead of processing a chain of subsequent shader calls as it's the case without using the .s file. It's a replacement of the normal rendering we do here.

That means, as soon as you have a .s file for something you are responsible yourself that all the rendering/shading stuff is done properly (by writing a shader doing so). Doable, but pretty some handwork.
  16:36:11  25 March 2013
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
Messages: 1519

---QUOTATION---
Try contacting K.D? He seems to be knowing what he's doing
---END QUOTATION---



Yeah, might be helpful. I'd leave that up to Millenia as the thread launcher
  15:53:57  25 March 2013
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890
Try contacting K.D? He seems to be knowing what he's doing
  12:24:34  25 March 2013
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
 

Message edited by:
Meltac
03/25/2013 12:25:54
Messages: 1519
Ok I checked that. The problem here are the assigned pixel and vertex shaders. They must be written the way you wanna have the result. By copying an existing .s file you assigned the "wrong" shaders, resulting in the weird rendering you got.

The question is, however, which shaders would be best here. If you would want the very same as with all other game objects, plus the additional cube map application, I'm afraid you'd have to write a specific vertex and pixel shader for that, because you can only assign one of each whereas for the other game objects various shaders are involved in the rendering pipeline in order to create the final result. So you'd probably have to write a new shader doing all those things in one file as the engine does during the entire rendering process (i.e. process geometry, create and fill depth buffer, apply lighting calculations, bump mapping, environment mapping, post processing and the like).

Might become heavy, if even possible. However as said before I'm not a pro in this field, so can't say for sure whether there's a better way to go.
  14:25:07  21 March 2013
profilee-mailreply Message URLTo the Top
Millenia
(Senior)
 
On forum: 04/04/2007
Messages: 130
I have, removing almost everything makes it entirely transparent. I copied that stuff from some vanilla .s model file, models_xmonolith.s I think.
  14:14:01  21 March 2013
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
 

Message edited by:
Meltac
03/21/2013 14:15:13
Messages: 1519
Hmm, the second looks really weird. There's definitely something missing.

How did you come to that specific content of the .s file you made? Have there been any special decisions to have it exactly this way? As it's way not the simplest .s file I've come across. Have you tried different settings there (e.g. leave some portions out)?
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2022 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.