3 registered members (AndrewAMD, VoroneTZ, dpn),
1,346
guests, and 10
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Double sided shader that works with PSSM
[Re: sivan]
#465941
05/18/17 08:58
05/18/17 08:58
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
Thank you! Can I rip it off the mapbuilder for personal use and to share it with those who is looking for shadowmapping? Do we need to give you any credits? Edit: ripped off the scsm, tried to run Scsm_Start in main loop, no errors, but no shadows (included all .fx files mentioned in both .c and .h files). Tried settings SHADOW flag for level_ent and even tried to set FLAG6 (saw in somewhere in your code, I guess in mapent.c ?) but no luck. Where can I find materials related to scsm to apply them for level blocks etc? Plus there is still issue with no moving shadows after terrain and grass models (which are animated via shader).
Last edited by 3run; 05/18/17 10:16.
|
|
|
Re: Double sided shader that works with PSSM
[Re: 3run]
#465946
05/18/17 13:19
05/18/17 13:19
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
Expert
|
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
materials are set dynamically in MBmaterials.c according to actual shadow_stencil value (can be -1, 1, 8)
else //if (shadow_stencil == (var)-1)
{
// MB materials got shader to have self shadows
effect_load(mtl_detail ,"sc_obj_sprite_MB.fx"); // obj_animGrass1_MB (no shadow response, bad with height fog) or sc_obj_sprite_MB
effect_load(mtl_shrub ,"sc_obj_sprite_MB.fx");
effect_load(mtl_grass ,"sc_obj_grass1_MB.fx");
effect_load(mtl_obstacle ,"sc_obj_model_MB.fx");
effect_load(mtl_tree ,"sc_obj_tree1_MB.fx");
effect_load(mtl_mapent ,"sc_obj_level_MB.fx");
effect_load(mtl_terrmdl ,"sc_obj_model_MB.fx");
effect_load(mtl_building ,"sc_obj_model_MB.fx");
// 3DGS materials can be used to not to have self shadow
// effect_load(mtl_terrain ,"sc_obj_model_MB.fx"); // not used, in action own shader
effect_load(mtl_model ,"sc_obj_model_MB.fx");
effect_load(mtl_sprite ,"sc_obj_sprite_st_MB.fx");
effect_load(mtl_flat ,"sc_obj_level_MB.fx");
effect_load(mtl_shaded ,"sc_obj_level_MB.fx");
effect_load(mtl_sky ,"sc_obj_sky_MB.fx");
// mtl_tree.flags |= ENABLE_TREE; // ENABLE_RENDER or ENABLE_TREE
// mtl_tree.event = sc_tree_billboard_event;
// RTS unit materials
{}
#ifdef PLAY02_PS
effect_load(mtl_bonesanim ,"sc_obj_bones_MB.fx"); // FIL // slower SM3.0 shader with pixel shader - capability of player colour display
#else
effect_load(mtl_bonesanim ,"obj_bones_MB.fx"); // FIL // no pixel shader
#endif
}
but as I mentioned in the MapBuilder thread yesterday, there is a bug in loading settings from a file, so next week it is going to be fixed.
|
|
|
Re: Double sided shader that works with PSSM
[Re: sivan]
#465994
05/19/17 10:02
05/19/17 10:02
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
I'm getting black screen :< Didn't load any settings, since they are set to default values in scsm header. Applied all shaders via effect_load, as in your example. Compiles with no errors, all .fx files are included. Maybe you remember facing this issue? I'm pretty sure that it's easy to fix, I'm just missing something. Also, what about not moving shadows for animated (via shader) grass and tress? Edit: also another question, were you able to get shadows working for animated sprites? Best regards!
Last edited by 3run; 05/19/17 11:06.
|
|
|
Re: Double sided shader that works with PSSM
[Re: sivan]
#466024
05/21/17 18:08
05/21/17 18:08
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
Sounds awesome man! Did your team win? It would be great if you could help us out with this. Having some shaders seperated from your project MapBuilder could be helpful for those who are still torment gamestudio Best regards!
|
|
|
Re: Double sided shader that works with PSSM
[Re: 3run]
#466205
05/31/17 19:33
05/31/17 19:33
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
Serious User
|
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Howdy, Sivan does your MapBuilder's shadowmapping work in combination with the shade-c (evo)? (I am using shade-c (evo) now and while the sun shadows are fairly sharp it drains fps alot) Having some shaders seperated from your project MapBuilder could be helpful for those who are still torment gamestudio grin , yes please be our knight in shiny armor
Last edited by Reconnoiter; 05/31/17 19:35.
|
|
|
Re: Double sided shader that works with PSSM
[Re: Reconnoiter]
#466219
06/01/17 16:45
06/01/17 16:45
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
Expert
|
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
no they are incompatible, moreover evo uses a deferred renderer I have no experience with.
I wanted to update Mapbuilder this week, but I have been very-very busy, so it should happen next week only...
my shadowmapping was developed for my RTS game, so its main purpose was to have something fast beside acceptable quality, preferably using only one depth view. it can be okay with high resolution beside keeping shadow area small, but near sharp edges some defects are often visible. so for a 1st or 3rd person game a pssm is better, but since using the stencil buffer with 3dgs results in bugs (related to transparency, mirror views, or terrain lod I don't know), a shader only version would be a better choice. I think I made earlier such a test project...
|
|
|
|