1 registered members (AndrewAMD),
1,244
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Specular Shader
[Re: Dooley]
#477163
05/26/19 12:27
05/26/19 12:27
|
Joined: Jan 2006
Posts: 168 Germany, Hannover
DexLoomer
Member
|
Member
Joined: Jan 2006
Posts: 168
Germany, Hannover
|
Hello, first of all many thanks for the support! The 'specTrans' Shader also looks great, as you can see on the picture: But what is the ´specBumpTrans´ shader for? This does not seem to work (only color_Map + Tranparenz_Map). Or am I doing something wrong? I commented it out in the main.c and assigned it to the cube in the WAD: In addition, I came across yet another problem. The object with the 'specTrans' Sahder takes on no shadow. The code is only extended by the shadow function:
///////////////////////////////
#include <acknex.h>
#include <default.c>
//#include <mtlFX.c>
#include <shadows.c>
///////////////////////////////
var shadow_flag = 1; // Einfacher Schatten
MATERIAL *mtlSpecTrans = {
effect = "SpecTrans.fx";
}
MATERIAL *mtlSpecBumpTrans = {
effect = "specBump.fx";
technique = "spec_trans";
}
// Startet Schatten bei dem der Schatten einer Entity
// auch auf sich selber geworfen werden kann.
function setShadow()
{
if (shadow_flag == 1) // Schatten: Stancil mit Eigenschatten
{
// stencil_blur(0);
pssm_run(0);
shadow_stencil = 1;
for(you = ent_next(NULL); you; you = ent_next(you))
{
reset(you, CAST);
set(you, SHADOW);
you.shadow = NULL;
}
}
if (shadow_flag == 2)
{
// Dieser Schatten kann nur aktiviert werden, wenn die
// Grafikkarte Shadermodel 3 oder höher unterstützt.
if (d3d_shaderversion >= 3)
{
// Deaktivieren des PSSM um dessen Parameter ändern zu können.
pssm_run(0);
// stencil_blur(0);
for(you = ent_next(NULL); you; you = ent_next(you)) {
reset(you, CAST);
set(you, SHADOW);
you.shadow = NULL;
}
shadow_stencil = 8;
// Clip-Werte so nah wie möglich zusammenlegen.
camera.clip_near = 30;
camera.clip_far = 3000;
// Fehlerquotienten setzen, dieser Wert wird durch ausprobieren
// optimiert.
pssm_fbias = 0.0005;
pssm_run(3);
}
else
{
printf("Ihre Grafikkarte unterstützt Shader Model 3 nicht!");
}
}
}
void main () {
video_mode = 10;
wait(3);
sun_light = 0;
level_load("spec.wmb");
setShadow();
def_move();
while(!key_esc) {
wait(1);
}
sys_exit(NULL);
}
A8-Com-v 8.47.1
|
|
|
Re: Specular Shader
[Re: DexLoomer]
#477165
05/26/19 15:33
05/26/19 15:33
|
Joined: Jun 2007
Posts: 1,337 Hiporope and its pain
txesmi
Serious User
|
Serious User
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
|
But what is the ´specBumpTrans´ shader for? This does not seem to work (only color_Map + Tranparenz_Map). It's the engine shader modification I explained before. I left it there for Dooley. He is working with A7. If the engines specBump works for him, it should work same. In addition, I came across yet another problem. The object with the 'specTrans' Sahder takes on no shadow. Entities drawn by the translucent pass do not cast nor receive stencil shadows. Stencil shadows are geometry based, translucent entities are discarded. I added a technique for solid rendering and fog, the only thing left, I guess. download
|
|
|
Re: Specular Shader
[Re: txesmi]
#477166
05/26/19 16:27
05/26/19 16:27
|
Joined: Jan 2006
Posts: 168 Germany, Hannover
DexLoomer
Member
|
Member
Joined: Jan 2006
Posts: 168
Germany, Hannover
|
Hey, txesmi So far, everything looks great! And you were right about the problem with the shadows. These are now working. I have one more question: If I do not use fog, or this with ´camera-> fog_start = 0;´ disable, the boxes continue to have a foggy surface. Is it possible to turn this on or off as well?
Last edited by DexLoomer; 05/26/19 19:37.
A8-Com-v 8.47.1
|
|
|
Re: Specular Shader
[Re: DexLoomer]
#477168
05/26/19 19:34
05/26/19 19:34
|
Joined: Jun 2007
Posts: 1,337 Hiporope and its pain
txesmi
Serious User
|
Serious User
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
|
Oh, it is true, I am sorry, forgot to multiply the fog term by 'vecFogColor.w' (68th code line of 'Spec.fx').
float fFog = saturate((camDist - vecFog.x) * vecFog.z) * vecFogColor.w;
Anyway, the fog is activated/deactivated by 'fog_color' variable in liteC. Salud!
|
|
|
Re: Specular Shader
[Re: Dooley]
#477171
05/26/19 22:15
05/26/19 22:15
|
Joined: Jan 2006
Posts: 168 Germany, Hannover
DexLoomer
Member
|
Member
Joined: Jan 2006
Posts: 168
Germany, Hannover
|
Hi Dooley, thanks for the hint, but I had some trouble with the mtl_specBump. Also, I find the shader of 'txesmi' better in comparison. Look ..on the left side ´mtl_specBump´ (with spec_map in the alpha channel of the color chart) and on the right side ´mtlSpecSolid´:
A8-Com-v 8.47.1
|
|
|
|