Gamestudio Links
Zorro Links
Newest Posts
How to save the contents of an array, WRS/resource
by Superku
Today at 07:43
Shadows Flickering
by Dooley
Today at 07:36
PSSM shadows are flickering and are change darkness level
by Dooley
Today at 02:46
Retrieving Zorro S after a couple of years
by chepstow
Yesterday at 22:53
[ALL STYLES] 2D Videogame Artist (pixel, vector, painted)
by jumpman
Yesterday at 21:18
AUM Magazine
Latest Screens
Triton Wing
ZeaL
Computer Repair Simulator
Collider (working title)
Space Rider
Who's Online
14 registered (jyd, Jens, MatPed, Calli, kmerlo, ibne, Dooley, Dalla, jumpman, Ezzett, 2 invisible), 392 Guests and 4 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
marx_vonde, A_Dearheart, adamcurry, lucnes, Mike429
17629 Registered Users
Page 2 of 2 < 1 2
Topic Options
Rate This Topic
#465941 - 05/18/17 10:58 Re: Double sided shader that works with PSSM [Re: sivan]
3run Offline
Expert

Registered: 05/05/09
Posts: 4860
Loc: 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? laugh

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).


Edited by 3run (05/18/17 12:16)
_________________________
Looking for free stuff?? Take a look here: http://badcom.at.ua

Top
#465946 - 05/18/17 15:19 Re: Double sided shader that works with PSSM [Re: 3run]
sivan Offline
Expert

Registered: 03/07/11
Posts: 3097
Loc: Budapest
materials are set dynamically in MBmaterials.c according to actual shadow_stencil value (can be -1, 1, 8)

Code:
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.
_________________________
Free world editor for 3D Gamestudio: MapBuilder Editor

Top
#465947 - 05/18/17 15:20 Re: Double sided shader that works with PSSM [Re: sivan]
sivan Offline
Expert

Registered: 03/07/11
Posts: 3097
Loc: Budapest
of course you can rip it off, just give me credits.
I think earlier I made a separate demo and shared in the forum...
_________________________
Free world editor for 3D Gamestudio: MapBuilder Editor

Top
#465994 - 05/19/17 12:02 Re: Double sided shader that works with PSSM [Re: sivan]
3run Offline
Expert

Registered: 05/05/09
Posts: 4860
Loc: 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!


Edited by 3run (05/19/17 13:06)
_________________________
Looking for free stuff?? Take a look here: http://badcom.at.ua

Top
#466022 - 05/21/17 17:09 Re: Double sided shader that works with PSSM [Re: 3run]
sivan Offline
Expert

Registered: 03/07/11
Posts: 3097
Loc: Budapest
I used animated sprites (as far lods of characters) with shadows. I don't know why you get black geometries, some material settings could be wrong. I can help next week I'm really tired now, I have finished today morning a one day long ultra-marathon in a team...
_________________________
Free world editor for 3D Gamestudio: MapBuilder Editor

Top
#466024 - 05/21/17 20:08 Re: Double sided shader that works with PSSM [Re: sivan]
3run Offline
Expert

Registered: 05/05/09
Posts: 4860
Loc: 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 grin

Best regards!
_________________________
Looking for free stuff?? Take a look here: http://badcom.at.ua

Top
Page 2 of 2 < 1 2


Moderator:  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | resources | magazine | manual | support faq | bugs | beta features

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) 3dgamestudio.net