Project

General

Profile

SO3Engine
SCOLLighting.cpp
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
25
34#include "SCOLPack/SO3SCOL.h"
35
36// Scene Graph includes
38
39
40// Pass Shadow Technique
41# define SO3_SHADOWTYPE_NONE 0
42# define SO3_SHADOWDETAILTYPE_ADDITIVE 1
43# define SO3_SHADOWDETAILTYPE_MODULATIVE 2
44# define SO3_SHADOWDETAILTYPE_INTEGRATED 4
45# define SO3_SHADOWDETAILTYPE_STENCIL 16
46# define SO3_SHADOWDETAILTYPE_TEXTURE 32
47# define SO3_SHADOWTYPE_STENCIL_MODULATIVE 18
48# define SO3_SHADOWTYPE_STENCIL_ADDITIVE 17
49# define SO3_SHADOWTYPE_TEXTURE_MODULATIVE 34
50# define SO3_SHADOWTYPE_TEXTURE_ADDITIVE 33
51# define SO3_SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED 37
52# define SO3_SHADOWTYPE_TEXTURE_MODULATIVE_INTEGRATED 38
53
54// Shadow Texture Camera Setup
55# define SO3_DEFAULT_SHADOW_CAMERA 0
56# define SO3_FOCUSED_SHADOW_CAMERA 1
57# define SO3_PLANE_SHADOW_CAMERA 2
58# define SO3_LISPSM_SHADOW_CAMERA 3
59
60
71{
72#ifdef SO3_DEBUG
73 MMechostr(MSKDEBUG, "SO3ShadowSetColor\n");
74#endif
75
76 int color = MTOI(MMpull(m));
77 int s = MMget(m, 0);
78 if ((s == NIL) || (color == NIL))
79 {
80 MMset(m, 0, NIL);
81 return 0;
82 }
83
84 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
85 if (scene == NULL)
86 {
87 MMset(m, 0, NIL);
88 return 0;
89 }
90
91 SShadowManager* currentShadow = scene->GetShadowManager();
92 if (currentShadow)
93 currentShadow->SetColour(color);
94
95 MMset(m, 0, ITOM(1));
96 return 0;
97}
98
99
109{
110#ifdef SO3_DEBUG
111 MMechostr(MSKDEBUG, "SO3ShadowGetColor\n");
112#endif
113
114 int s = MMget(m, 0);
115 if (s == NIL)
116 {
117 MMset(m, 0, NIL);
118 return 0;
119 }
120
121 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
122 if (scene == NULL)
123 {
124 MMset(m, 0, NIL);
125 return 0;
126 }
127
128 int val = 0;
129 SShadowManager* currentShadow = scene->GetShadowManager();
130 if (currentShadow)
131 val = currentShadow->GetColour();
132
133 MMset(m, 0, ITOM(val));
134 return 0;
135}
136
137
148{
149#ifdef SO3_DEBUG
150 MMechostr(MSKDEBUG, "SO3ShadowSetSelfShadow\n");
151#endif
152
153 int state = MMpull(m);
154 int s = MMget(m, 0);
155 if (s == NIL)
156 {
157 MMset(m, 0, NIL);
158 return 0;
159 }
160
161 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
162 if (scene == 0)
163 {
164 MMset(m, 0, NIL);
165 return 0;
166 }
167
168 SShadowManager* currentShadow = scene->GetShadowManager();
169 if (currentShadow)
170 if (MTOI(state) == 1)
171 currentShadow->SetSelfShadow(true);
172 else
173 currentShadow->SetSelfShadow(false);
174
175 MMset(m, 0, ITOM(1));
176 return 0;
177}
178
179
189{
190#ifdef SO3_DEBUG
191 MMechostr(MSKDEBUG, "SO3ShadowGetSelfShadow\n");
192#endif
193
194 int s = MMget(m, 0);
195 if (s == NIL)
196 {
197 MMset(m, 0, NIL);
198 return 0;
199 }
200
201 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
202 if (scene == NULL)
203 {
204 MMset(m, 0, NIL);
205 return 0;
206 }
207
208 int val = 0;
209 SShadowManager* currentShadow = scene->GetShadowManager();
210 if (currentShadow)
211 if (currentShadow->GetSelfShadow())
212 val = 1;
213
214 MMset(m, 0, ITOM(val));
215 return 0;
216}
217
218
229{
230#ifdef SO3_DEBUG
231 MMechostr(MSKDEBUG, "SO3ShadowSetTextureSize\n");
232#endif
233
234 int val = MMpull(m);
235 int s = MMget(m, 0);
236 if ((s == NIL) || (val == NIL))
237 {
238 MMset(m, 0, NIL);
239 return 0;
240 }
241
242 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
243 if (scene == NULL)
244 {
245 MMset(m, 0, NIL);
246 return 0;
247 }
248
249 try
250 {
251 SShadowManager* currentShadow = scene->GetShadowManager();
252 if (currentShadow)
253 currentShadow->SetTextureSize(MTOI(val));
254 }
255 catch (Ogre::Exception &e)
256 {
257 MMechostr(MSKDEBUG, "An exception has occurred: %s\n", e.what());
258 MMset(m, 0, NIL);
259 return 0;
260 }
261
262 MMset(m, 0, ITOM(1));
263 return 0;
264}
265
266
276{
277#ifdef SO3_DEBUG
278 MMechostr(MSKDEBUG, "SO3ShadowGetTextureSize\n");
279#endif
280
281 int s = MMget(m, 0);
282 if (s == NIL)
283 {
284 MMset(m, 0, NIL);
285 return 0;
286 }
287
288 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
289 if (scene == NULL)
290 {
291 MMset(m, 0, NIL);
292 return 0;
293 }
294
295 SShadowManager* currentShadow = scene->GetShadowManager();
296 if (currentShadow)
297 {
298 int val = currentShadow->GetTextureSize();
299 MMset(m, 0, ITOM(val));
300 }
301 else
302 MMset(m, 0, NIL);
303
304 return 0;
305}
306
307
325{
326#ifdef SO3_DEBUG
327 MMechostr(MSKDEBUG, "SO3SceneSetShadowPreset\n");
328#endif
329
330 int val = MTOI(MMpull(m));
331 int s = MMget(m, 0);
332 if ((val == NIL) || (s == NIL))
333 {
334 MMset(m, 0, NIL);
335 return 0;
336 }
337
338 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
339 if (scene == NULL)
340 {
341 MMset(m, 0, NIL);
342 return 0;
343 }
344 try
345 {
346 //disable stencil
347 if (val == SShadowManager::SO3_SHADOWS_STENCIL)
348 val = SShadowManager::SO3_SHADOWS_NONE;
349
350 scene->SetShadowType(static_cast <SShadowManager::ShadowType> (val));
351 }
352 catch (Ogre::Exception &e)
353 {
354 MMechostr(MSKDEBUG, "An exception has occurred: %s\n", e.what());
355 MMset(m, 0, NIL);
356 return 0;
357 }
358 MMset(m, 0, ITOM(1));
359 return 0;
360}
361
362
379{
380#ifdef SO3_DEBUG
381 MMechostr(MSKDEBUG, "SO3SceneGetShadowPreset\n");
382#endif
383
384 int s = MMget(m, 0);
385 if (s == NIL)
386 {
387 MMset(m, 0, NIL);
388 return 0;
389 }
390
391 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
392 if (scene == NULL)
393 {
394 MMset(m, 0, NIL);
395 return 0;
396 }
397
398 MMset(m, 0, ITOM(scene->GetShadowType()));
399 return 0;
400}
401
402
416{
417#ifdef SO3_DEBUG
418 MMechostr(MSKDEBUG, "SO3SceneGetShadowLightingTechnique\n");
419#endif
420
421 int s = MMget(m, 0);
422 if (s == NIL)
423 {
424 MMset(m, 0, NIL);
425 return 0;
426 }
427
428 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
429 if (scene == NULL)
430 {
431 MMset(m, 0, NIL);
432 return 0;
433 }
434
435 SShadowManager* currentShadow = scene->GetShadowManager();
436 if (currentShadow)
437 MMset(m, 0, ITOM(currentShadow->GetLightingTechnique()));
438 else
439 MMset(m, 0, NIL);
440
441 return 0;
442}
443
444
459{
460#ifdef SO3_DEBUG
461 MMechostr(MSKDEBUG, "SO3SceneSetShadowLightingTechnique\n");
462#endif
463
464 int tec = MTOI(MMpull(m));
465 int s = MMget(m, 0);
466 if ((s == NIL) || (tec == NIL))
467 {
468 MMset(m, 0, NIL);
469 return 0;
470 }
471
472 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
473 if (scene == NULL)
474 {
475 MMset(m, 0, NIL);
476 return 0;
477 }
478
479 SShadowManager* currentShadow = scene->GetShadowManager();
480 if (currentShadow)
481 currentShadow->SetLightingTechnique(static_cast <SShadowManager::ShadowLightingType> (tec));
482
483 MMset(m, 0, ITOM(1));
484 return 0;
485}
486
487
505{
506#ifdef SO3_DEBUG
507 MMechostr(MSKDEBUG, "SO3SceneSetShadowQuality\n");
508#endif
509
510 int val = MTOI(MMpull(m));
511 int s = MMget(m, 0);
512 if ((val == NIL) || (s == NIL))
513 {
514 MMset(m, 0, NIL);
515 return 0;
516 }
517
518 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
519 if (scene == NULL)
520 {
521 MMset(m, 0, NIL);
522 return 0;
523 }
524 try
525 {
526 scene->SetShadowQuality(static_cast <SShadowManager::ShadowQuality> (val));
527 }
528 catch (Ogre::Exception &e)
529 {
530 MMechostr(MSKDEBUG, "An exception has occurred: %s\n", e.what());
531 MMset(m, 0, NIL);
532 return 0;
533 }
534 MMset(m, 0, ITOM(1));
535 return 0;
536}
537
538
555{
556#ifdef SO3_DEBUG
557 MMechostr(MSKDEBUG, "SO3SceneGetShadowQuality\n");
558#endif
559
560 int s = MMget(m, 0);
561 if (s == NIL)
562 {
563 MMset(m, 0, NIL);
564 return 0;
565 }
566
567 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
568 if (scene == NULL)
569 {
570 MMset(m, 0, NIL);
571 return 0;
572 }
573
574 MMset(m, 0, ITOM(scene->GetShadowQuality()));
575 return 0;
576}
577
578
589{
590#ifdef SO3_DEBUG
591 MMechostr(MSKDEBUG, "SO3SceneSetShadowTextureCount\n");
592#endif
593
594 int val = MTOI(MMpull(m));
595 int s = MMget(m, 0);
596 if ((s == NIL) || (val == NIL))
597 {
598 MMset(m, 0, NIL);
599 return 0;
600 }
601 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
602 if (scene == NULL)
603 {
604 MMset(m, 0, NIL);
605 return 0;
606 }
607 try
608 {
609 scene->O3SceneManager->setShadowTextureCount(val);
610 }
611 catch (Ogre::Exception &e)
612 {
613 MMechostr(MSKDEBUG, "An exception has occurred: %s\n", e.what());
614 MMset(m, 0, NIL);
615 return 0;
616 }
617
618 MMset(m, 0, ITOM(1));
619 return 0;
620}
621
631{
632#ifdef SO3_DEBUG
633 MMechostr(MSKDEBUG, "SO3SceneSetDefaultShadowCamera\n");
634#endif
635
636 int s = MMget(m, 0);
637 if ((s == NIL))
638 {
639 return 0;
640 }
641
642 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
643 if (scene == NULL)
644 {
645 MMset(m, 0, NIL);
646 return 0;
647 }
648
649 scene->SetShadowType(SShadowManager::SO3_SHADOWS_NONE);
650
651 MMset(m, 0, ITOM(1));
652 return 0;
653}
654
655
665{
666#ifdef SO3_DEBUG
667 MMechostr(MSKDEBUG, "SO3SceneSetFocusedShadowCamera\n");
668#endif
669
670 int s = MMget(m, 0);
671 if ((s == NIL))
672 {
673 MMset(m, 0, NIL);
674 return 0;
675 }
676 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
677 if (scene == NULL)
678 {
679 MMset(m, 0, NIL);
680 return 0;
681 }
682 try
683 {
684 scene->O3SceneManager->setShadowCameraSetup(Ogre::ShadowCameraSetupPtr(OGRE_NEW Ogre::FocusedShadowCameraSetup()));
685 //scene->shadowCameraSetup = SO3_FOCUSED_SHADOW_CAMERA;
686 }
687 catch (Ogre::Exception &e)
688 {
689 MMechostr(MSKDEBUG, "An exception has occurred: %s\n", e.what());
690 MMset(m, 0, NIL);
691 return 0;
692 }
693 MMset(m, 0, ITOM(1));
694 return 0;
695}
696
697
707{
708#ifdef SO3_DEBUG
709 MMechostr(MSKDEBUG, "SO3SceneSetLISPSMShadowCamera\n");
710#endif
711
712 int s = MMget(m, 0);
713 if ((s == NIL))
714 {
715 MMset(m, 0, NIL);
716 return 0;
717 }
718 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
719 if (scene == NULL)
720 {
721 MMset(m, 0, NIL);
722 return 0;
723 }
724 try
725 {
726 scene->O3SceneManager->setShadowCameraSetup(Ogre::ShadowCameraSetupPtr(OGRE_NEW Ogre::LiSPSMShadowCameraSetup()));
727 //scene->shadowCameraSetup = SO3_LISPSM_SHADOW_CAMERA;
728 }
729 catch (Ogre::Exception &e)
730 {
731 MMechostr(MSKDEBUG, "An exception has occurred: %s\n", e.what());
732 MMset(m, 0, NIL);
733 return 0;
734 }
735 MMset(m, 0, ITOM(1));
736 return 0;
737}
738
739
751{
752#ifdef SO3_DEBUG
753 MMechostr(MSKDEBUG, "SO3SceneSetPlaneShadowCamera\n");
754#endif
755
756 int d = MMpull(m);
757 int vec = MTOP(MMpull(m));
758 int s = MMget(m, 0);
759 if ((s == NIL) || (d == NIL))
760 {
761 MMset(m, 0, NIL);
762 return 0;
763 }
764 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
765 if (scene == NULL)
766 {
767 MMset(m, 0, NIL);
768 return 0;
769 }
770 try
771 {
772 // TODO memory leak here?
773 Ogre::MovablePlane* plane = OGRE_NEW Ogre::MovablePlane("PlaneShadowCamera");
774 Ogre::Vector3 vecteur;
775 if (vec == NIL)
776 {
777 vecteur.NEGATIVE_UNIT_Y;
778 }
779 else
780 {
781 vecteur.x = MTOF(MMfetch(m, vec, 0));
782 vecteur.y = MTOF(MMfetch(m, vec, 1));
783 vecteur.z = MTOF(MMfetch(m, vec, 2));
784 }
785 plane->d = MTOF(d);
786 plane->normal = vecteur;
787
788 //scene->O3SceneManager->setShadowCameraSetup(Ogre::ShadowCameraSetupPtr(OGRE_NEW Ogre::PlaneOptimalShadowCameraSetup(plane)));
789 //scene->shadowCameraSetup = SO3_PLANE_SHADOW_CAMERA;
790 }
791 catch (Ogre::Exception &e)
792 {
793 MMechostr(MSKDEBUG, "An exception has occurred: %s\n", e.what());
794 MMset(m, 0, NIL);
795 return 0;
796 }
797
798 MMset(m, 0, ITOM(1));
799 return 0;
800}
801
802
813{
814#ifdef SO3_DEBUG
815 MMechostr(MSKDEBUG, "SO3SceneSetShadowDirectionalLightExtrusionDistance\n");
816#endif
817
818 int val = MMpull(m);
819 int s = MMget(m, 0);
820 if (s == NIL)
821 {
822 MMset(m, 0, NIL);
823 return 0;
824 }
825
826 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
827 if (scene == NULL)
828 {
829 MMset(m, 0, NIL);
830 return 0;
831 }
832
833 float extr = (val == NIL) ? 0.0f : MTOF(val);
834
835 SShadowManager* currentShadow = scene->GetShadowManager();
836 if (currentShadow)
837 currentShadow->SetShadowDirectionalLightExtrusionDistance(extr);
838
839 MMset(m, 0, ITOM(1));
840 return 0;
841}
842
843
854{
855#ifdef SO3_DEBUG
856 MMechostr(MSKDEBUG, "SO3SceneSetShadowFarDistance\n");
857#endif
858
859 int val = MMpull(m);
860 int s = MMget(m, 0);
861 if ((s == NIL) || (val == NIL))
862 {
863 MMset(m, 0, NIL);
864 return 0;
865 }
866
867 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
868 if (scene == NULL)
869 {
870 MMset(m, 0, NIL);
871 return 0;
872 }
873
874 SShadowManager* currentShadow = scene->GetShadowManager();
875 if (currentShadow)
876 currentShadow->SetShadowFarDistance(MTOF(val));
877
878 MMset(m, 0, ITOM(1));
879 return 0;
880}
881
882
893{
894#ifdef SO3_DEBUG
895 MMechostr(MSKDEBUG, "SO3SceneSetShadowTextureFadeStart\n");
896#endif
897
898 int val = MMpull(m);
899 int s = MMget(m, 0);
900 if ((s == NIL) || (val == NIL))
901 {
902 MMset(m, 0, NIL);
903 return 0;
904 }
905
906 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
907 if (scene == NULL)
908 {
909 MMset(m, 0, NIL);
910 return 0;
911 }
912
913 SShadowManager* currentShadow = scene->GetShadowManager();
914 if (currentShadow)
915 currentShadow->SetShadowFadeStart(MTOF(val));
916
917 MMset(m, 0, ITOM(1));
918 return 0;
919}
920
921
931{
932#ifdef SO3_DEBUG
933 MMechostr(MSKDEBUG, "SO3SceneGetShadowTextureFadeStart\n");
934#endif
935
936 int s = MMget(m, 0);
937 if ((s == NIL))
938 {
939 MMset(m, 0, NIL);
940 return 0;
941 }
942
943 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
944 if (scene == NULL)
945 {
946 MMset(m, 0, NIL);
947 return 0;
948 }
949
950 SShadowManager* currentShadow = scene->GetShadowManager();
951 if (currentShadow)
952 MMset(m, 0, FTOM(currentShadow->GetShadowFadeStart()));
953 else
954 MMset(m, 0, NIL);
955
956 return 0;
957}
958
959
970{
971#ifdef SO3_DEBUG
972 MMechostr(MSKDEBUG, "SO3SceneSetShadowTextureFadeEnd\n");
973#endif
974
975 int val = MMpull(m);
976 int s = MMget(m, 0);
977 if ((s == NIL) || (val == NIL))
978 {
979 MMset(m, 0, NIL);
980 return 0;
981 }
982
983 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
984 if (scene == NULL)
985 {
986 MMset(m, 0, NIL);
987 return 0;
988 }
989
990 SShadowManager* currentShadow = scene->GetShadowManager();
991 if (currentShadow)
992 currentShadow->SetShadowFadeEnd(MTOF(val));
993
994 MMset(m, 0, ITOM(1));
995 return 0;
996}
997
998
1008{
1009#ifdef SO3_DEBUG
1010 MMechostr(MSKDEBUG, "SO3SceneGetShadowTextureFadeEnd\n");
1011#endif
1012
1013 int s = MMget(m, 0);
1014 if (s == NIL)
1015 {
1016 MMset(m, 0, NIL);
1017 return 0;
1018 }
1019
1020 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1021 if (scene == NULL)
1022 {
1023 MMset(m, 0, NIL);
1024 return 0;
1025 }
1026
1027 SShadowManager* currentShadow = scene->GetShadowManager();
1028 if (currentShadow)
1029 MMset(m, 0, FTOM(currentShadow->GetShadowFadeEnd()));
1030 else
1031 MMset(m, 0, NIL);
1032
1033 return 0;
1034}
1035
1036
1060{
1061#ifdef SO3_DEBUG
1062 MMechostr(MSKDEBUG, "SO3SceneGetShadowTechnique\n");
1063#endif
1064
1065 int s = MMget(m, 0);
1066 if ((s == NIL))
1067 {
1068 MMset(m, 0, NIL);
1069 return 0;
1070 }
1071 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1072 if (scene == NULL)
1073 {
1074 MMset(m, 0, NIL);
1075 return 0;
1076 }
1077 if (scene->O3SceneManager->getShadowTechnique() == Ogre::SHADOWTYPE_NONE)
1078 MMset(m, 0, ITOM(SO3_SHADOWTYPE_NONE));
1079 else if (scene->O3SceneManager->getShadowTechnique() == Ogre::SHADOWDETAILTYPE_ADDITIVE)
1080 MMset(m, 0, ITOM(SO3_SHADOWDETAILTYPE_ADDITIVE));
1081 else if (scene->O3SceneManager->getShadowTechnique() == Ogre::SHADOWDETAILTYPE_MODULATIVE)
1082 MMset(m, 0, ITOM(SO3_SHADOWDETAILTYPE_MODULATIVE));
1083 else if (scene->O3SceneManager->getShadowTechnique() == Ogre::SHADOWDETAILTYPE_STENCIL)
1084 MMset(m, 0, ITOM(SO3_SHADOWDETAILTYPE_STENCIL));
1085 else if (scene->O3SceneManager->getShadowTechnique() == Ogre::SHADOWDETAILTYPE_TEXTURE)
1086 MMset(m, 0, ITOM(SO3_SHADOWDETAILTYPE_TEXTURE));
1087 else if (scene->O3SceneManager->getShadowTechnique() == Ogre::SHADOWTYPE_STENCIL_MODULATIVE)
1088 MMset(m, 0, ITOM(SO3_SHADOWTYPE_STENCIL_MODULATIVE));
1089 else if (scene->O3SceneManager->getShadowTechnique() == Ogre::SHADOWTYPE_STENCIL_ADDITIVE)
1090 MMset(m, 0, ITOM(SO3_SHADOWTYPE_STENCIL_ADDITIVE));
1091 else if (scene->O3SceneManager->getShadowTechnique() == Ogre::SHADOWTYPE_TEXTURE_MODULATIVE)
1092 MMset(m, 0, ITOM(SO3_SHADOWTYPE_TEXTURE_MODULATIVE));
1093 else if (scene->O3SceneManager->getShadowTechnique() == Ogre::SHADOWTYPE_TEXTURE_ADDITIVE)
1094 MMset(m, 0, ITOM(SO3_SHADOWTYPE_TEXTURE_ADDITIVE));
1095 else if (scene->O3SceneManager->getShadowTechnique() == Ogre::SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED)
1096 MMset(m, 0, ITOM(SO3_SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED));
1097 else if (scene->O3SceneManager->getShadowTechnique() == Ogre::SHADOWDETAILTYPE_ADDITIVE)
1098 MMset(m, 0, ITOM(SO3_SHADOWDETAILTYPE_ADDITIVE));
1099 else if (scene->O3SceneManager->getShadowTechnique() == Ogre::SHADOWTYPE_TEXTURE_MODULATIVE_INTEGRATED)
1100 MMset(m, 0, ITOM(SO3_SHADOWTYPE_TEXTURE_MODULATIVE_INTEGRATED));
1101 else
1102 MMset(m, 0, NIL);
1103 return 0;
1104}
1105
1106
1117{
1118#ifdef SO3_DEBUG
1119 MMechostr(MSKDEBUG, "SO3SceneSetShadowDirLightTextureOffset\n");
1120#endif
1121
1122 int val = MMpull(m);
1123 int s = MMget(m, 0);
1124 if ((s == NIL) || (val == NIL))
1125 {
1126 MMset(m, 0, NIL);
1127 return 0;
1128 }
1129 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1130 if (scene == NULL)
1131 {
1132 MMset(m, 0, NIL);
1133 return 0;
1134 }
1135 scene->O3SceneManager->setShadowDirLightTextureOffset(MTOF(val));
1136 MMset(m, 0, ITOM(1));
1137 return 0;
1138}
1139
1140
1153{
1154#ifdef SO3_DEBUG
1155 MMechostr(MSKDEBUG, "SO3SceneGetShadowCameraSetup\n");
1156#endif
1157
1158 int s = MMget(m, 0);
1159 if ((s == NIL))
1160 {
1161 MMset(m, 0, NIL);
1162 return 0;
1163 }
1164 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1165 if (scene == NULL)
1166 {
1167 MMset(m, 0, NIL);
1168 return 0;
1169 }
1170 int val = 0;//scene->shadowCameraSetup;
1171 MMset(m, 0, ITOM(val));
1172 return 0;
1173}
1174
1175
1185{
1186#ifdef SO3_DEBUG
1187 MMechostr(MSKDEBUG, "SO3SceneGetShadowDirectionalLightExtrusionDistance\n");
1188#endif
1189
1190 int s = MMget(m, 0);
1191 if (s == NIL)
1192 {
1193 MMset(m, 0, NIL);
1194 return 0;
1195 }
1196
1197 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1198 if (scene == NULL)
1199 {
1200 MMset(m, 0, NIL);
1201 return 0;
1202 }
1203
1204 SShadowManager* currentShadow = scene->GetShadowManager();
1205 if (currentShadow)
1206 {
1207 float val = currentShadow->GetShadowDirectionalLightExtrusionDistance();
1208 MMset(m, 0, FTOM(val));
1209 }
1210 else
1211 {
1212 MMset(m, 0, NIL);
1213 }
1214
1215 return 0;
1216}
1217
1218
1228{
1229#ifdef SO3_DEBUG
1230 MMechostr(MSKDEBUG, "SO3SceneGetShadowFarDistance\n");
1231#endif
1232
1233 int s = MMget(m, 0);
1234 if ((s == NIL))
1235 {
1236 MMset(m, 0, NIL);
1237 return 0;
1238 }
1239 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1240 if (scene == NULL)
1241 {
1242 MMset(m, 0, NIL);
1243 return 0;
1244 }
1245
1246 SShadowManager* currentShadow = scene->GetShadowManager();
1247 if (currentShadow)
1248 MMset(m, 0, FTOM(currentShadow->GetShadowFarDistance()));
1249 else
1250 MMset(m, 0, NIL);
1251
1252 return 0;
1253}
1254
1255
1265{
1266#ifdef SO3_DEBUG
1267 MMechostr(MSKDEBUG, "SO3SceneGetShadowDirLightTextureOffset\n");
1268#endif
1269
1270 int s = MMget(m, 0);
1271 if ((s == NIL))
1272 {
1273 MMset(m, 0, NIL);
1274 return 0;
1275 }
1276 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1277 if (scene == NULL)
1278 {
1279 MMset(m, 0, NIL);
1280 return 0;
1281 }
1282 float val = scene->O3SceneManager->getShadowDirLightTextureOffset();
1283
1284 MMset(m, 0, FTOM(val));
1285 return 0;
1286}
1287
1288
1298{
1299#ifdef SO3_DEBUG
1300 MMechostr(MSKDEBUG, "SO3SceneGetShadowTextureCount\n");
1301#endif
1302
1303 int s = MMget(m, 0);
1304 if ((s == NIL))
1305 {
1306 MMset(m, 0, NIL);
1307 return 0;
1308 }
1309 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1310 if (scene == NULL)
1311 {
1312 MMset(m, 0, NIL);
1313 return 0;
1314 }
1315 int val = (int)scene->O3SceneManager->getShadowTextureConfigList().size();
1316 MMset(m, 0, ITOM(val));
1317 return 0;
1318}
1319
1320
1345{
1346#ifdef SO3_DEBUG
1347 MMechostr(MSKDEBUG, "SO3SceneSetShadowTechnique\n");
1348#endif
1349
1350 int tec = MTOI(MMpull(m));
1351 int s = MMget(m, 0);
1352 if ((s == NIL) || (tec == NIL))
1353 {
1354 MMset(m, 0, NIL);
1355 return 0;
1356 }
1357 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1358
1359 //TODO TEST
1360 // To avoid Rendering Problem Disable the possibility to set Stencil Based Shadow when scene has Texture Unit States with content_type shadow
1361 /*
1362 if(((Ogre::ShadowTechnique)tec==SO3_SHADOWTYPE_STENCIL_ADDITIVE ||(Ogre::ShadowTechnique)tec==SO3_SHADOWTYPE_STENCIL_MODULATIVE||(Ogre::ShadowTechnique)tec==SO3_SHADOWTYPE_NONE))
1363 {
1364 Ogre::ResourceManager::ResourceMapIterator it = scene->O3MaterialManager->getResourceIterator();
1365 while(it.hasMoreElements())
1366 {
1367 Ogre::MaterialPtr curMat = it.getNext();
1368 for(int i=0;i<curMat->getNumTechniques();i++)
1369 for(int j=0;j<curMat->getTechnique(i)->getNumPasses();j++)
1370 for(int k=0;k<curMat->getTechnique(i)->getPass(j)->getNumTextureUnitStates();k++)
1371 if(curMat->getTechnique(i)->getPass(j)->getTextureUnitState(k)->getContentType()==Ogre::TextureUnitState::CONTENT_SHADOW)
1372 {
1373 curMat->getTechnique(i)->getPass(j)->removeTextureUnitState(k);
1374 Ogre::LogManager::getSingleton().logMessage("Reset material : " + curMat->getName() + " cause it used a shadow map texture integrated \n ", Ogre::LML_CRITICAL,true) ;
1375 curMat->_notifyNeedsRecompile();
1376 }
1377 }
1378 }*/
1379
1380 //disable stencil
1381 if (((Ogre::ShadowTechnique)tec == SO3_SHADOWTYPE_STENCIL_ADDITIVE || (Ogre::ShadowTechnique)tec == SO3_SHADOWTYPE_STENCIL_MODULATIVE))
1382 tec = SO3_SHADOWTYPE_NONE;
1383
1384 scene->O3SceneManager->setShadowTechnique((Ogre::ShadowTechnique)tec);
1385
1386 /*if(((Ogre::ShadowTechnique)tec==SO3_SHADOWTYPE_STENCIL_ADDITIVE ||(Ogre::ShadowTechnique)tec==SO3_SHADOWTYPE_STENCIL_MODULATIVE||(Ogre::ShadowTechnique)tec==SO3_SHADOWTYPE_NONE))
1387 //TODO test opengl and set to FLOAT16
1388 scene->O3SceneManager->setShadowTexturePixelFormat(Ogre::PF_FLOAT32_R);
1389 else
1390 scene->O3SceneManager->setShadowTexturePixelFormat(Ogre::PF_X8R8G8B8);
1391 */
1392 MMset(m, 0, ITOM(1));
1393 return 0;
1394}
1395
1396
1407{
1408#ifdef SO3_DEBUG
1409 MMechostr(MSKDEBUG, "SO3SceneSetShadowCaster\n");
1410#endif
1411
1412 int c = MMpull(m);
1413 int s = MMget(m, 0);
1414 if ((s == NIL) || (c == NIL))
1415 {
1416 MMset(m, 0, NIL);
1417 return 0;
1418 }
1419
1420 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1421 try
1422 {
1423 Ogre::MaterialPtr mCaster;
1424 mCaster.reset();
1425 mCaster = scene->O3MaterialManager->getByName(MMstartstr(m, MTOP(c)));
1426 if (!mCaster)
1427 {
1428 MMset(m, 0, NIL);
1429 return 0;
1430 }
1431 scene->O3SceneManager->setShadowTextureCasterMaterial(mCaster);
1432 scene->materialCaster = mCaster;
1433 }
1434 catch (Ogre::Exception &e)
1435 {
1436 MMechostr(MSKDEBUG, "An exception has occurred: %s\n", e.what());
1437 MMset(m, 0, NIL);
1438 return 0;
1439 }
1440
1441 MMset(m, 0, ITOM(1));
1442 return 0;
1443}
1444
1445
1456{
1457#ifdef SO3_DEBUG
1458 MMechostr(MSKDEBUG, "SO3SceneSetShadowReceiver\n");
1459#endif
1460
1461 int r = MMpull(m);
1462 int s = MMget(m, 0);
1463 if ((s == NIL) || (r == NIL))
1464 {
1465 MMset(m, 0, NIL);
1466 return 0;
1467 }
1468
1469 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1470 try
1471 {
1472 Ogre::MaterialPtr mReceiver;
1473 mReceiver.reset();
1474
1475 mReceiver = scene->O3MaterialManager->getByName(MMstartstr(m, MTOP(r)));
1476 if (!mReceiver)
1477 {
1478 MMset(m, 0, NIL);
1479 return 0;
1480 }
1481 scene->O3SceneManager->setShadowTextureReceiverMaterial(mReceiver);
1482 scene->materialReceiver = mReceiver;
1483
1484 }
1485 catch (Ogre::Exception &e)
1486 {
1487 MMechostr(MSKDEBUG, "An exception has occurred: %s\n", e.what());
1488 MMset(m, 0, NIL);
1489 return 0;
1490 }
1491
1492 MMset(m, 0, ITOM(1));
1493 return 0;
1494}
1495
1496
1506{
1507#ifdef SO3_DEBUG
1508 MMechostr(MSKDEBUG, "SO3SceneGetShadowCaster\n");
1509#endif
1510
1511 int s = MMpull(m);
1512 if ((s == NIL))
1513 {
1514 MMpush(m, NIL);
1515 return 0;
1516 }
1517 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1518 try
1519 {
1520 if (!scene->materialCaster)
1521 {
1522 MMpush(m, NIL);
1523 return 0;
1524 }
1525
1526 return Mpushstrbloc(m, (char*)(scene->materialCaster->getName().c_str()));
1527 }
1528 catch (Ogre::Exception &e)
1529 {
1530 MMechostr(MSKDEBUG, "An exception has occurred: %s\n", e.what());
1531 MMpush(m, NIL);
1532 return 0;
1533 }
1534 return 0;
1535}
1536
1537
1547{
1548#ifdef SO3_DEBUG
1549 MMechostr(MSKDEBUG, "SO3SceneGetShadowReceiver\n");
1550#endif
1551
1552 int s = MMpull(m);
1553 if (s == NIL)
1554 {
1555 MMpush(m, NIL);
1556 return 0;
1557 }
1558
1559 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
1560 try
1561 {
1562 if (!scene->materialReceiver)
1563 {
1564 MMpush(m, NIL);
1565 return 0;
1566 }
1567 return Mpushstrbloc(m, (char*)(scene->materialReceiver->getName().c_str()));
1568
1569 }
1570 catch (Ogre::Exception &e)
1571 {
1572 MMechostr(MSKDEBUG, "An exception has occurred: %s\n", e.what());
1573 MMpush(m, NIL);
1574 return 0;
1575 }
1576 return 0;
1577}
1578
1579
1580NativeDefinition natSO3Lighting[] = {
1581 { "SO3_SHADOWTYPE_NONE", TYPVAR, "I", SCOL_TYPTYPE(SO3_SHADOWTYPE_NONE) },
1582 { "SO3_SHADOWDETAILTYPE_ADDITIVE", TYPVAR, "I", SCOL_TYPTYPE(SO3_SHADOWDETAILTYPE_ADDITIVE) },
1583 { "SO3_SHADOWDETAILTYPE_MODULATIVE", TYPVAR, "I", SCOL_TYPTYPE(SO3_SHADOWDETAILTYPE_MODULATIVE) },
1584 { "SO3_SHADOWDETAILTYPE_INTEGRATED", TYPVAR, "I", SCOL_TYPTYPE(SO3_SHADOWDETAILTYPE_INTEGRATED) },
1585 { "SO3_SHADOWDETAILTYPE_STENCIL", TYPVAR, "I", SCOL_TYPTYPE(SO3_SHADOWDETAILTYPE_STENCIL) },
1586 { "SO3_SHADOWDETAILTYPE_TEXTURE", TYPVAR, "I", SCOL_TYPTYPE(SO3_SHADOWDETAILTYPE_TEXTURE) },
1587 { "SO3_SHADOWTYPE_STENCIL_MODULATIVE", TYPVAR, "I", SCOL_TYPTYPE(SO3_SHADOWTYPE_STENCIL_MODULATIVE) },
1588 { "SO3_SHADOWTYPE_STENCIL_ADDITIVE", TYPVAR, "I", SCOL_TYPTYPE(SO3_SHADOWTYPE_STENCIL_ADDITIVE) },
1589 { "SO3_SHADOWTYPE_TEXTURE_MODULATIVE", TYPVAR, "I", SCOL_TYPTYPE(SO3_SHADOWTYPE_TEXTURE_MODULATIVE) },
1590 { "SO3_SHADOWTYPE_TEXTURE_ADDITIVE", TYPVAR, "I", SCOL_TYPTYPE(SO3_SHADOWTYPE_TEXTURE_ADDITIVE) },
1591 { "SO3_SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED", TYPVAR, "I", SCOL_TYPTYPE(SO3_SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED) },
1592 { "SO3_SHADOWTYPE_TEXTURE_MODULATIVE_INTEGRATED", TYPVAR, "I", SCOL_TYPTYPE(SO3_SHADOWTYPE_TEXTURE_MODULATIVE_INTEGRATED) },
1593 { "SO3_DEFAULT_SHADOW_CAMERA", TYPVAR, "I", SCOL_TYPTYPE(SO3_DEFAULT_SHADOW_CAMERA) },
1594 { "SO3_FOCUSED_SHADOW_CAMERA", TYPVAR, "I", SCOL_TYPTYPE(SO3_FOCUSED_SHADOW_CAMERA) },
1595 { "SO3_PLANE_SHADOW_CAMERA", TYPVAR, "I", SCOL_TYPTYPE(SO3_PLANE_SHADOW_CAMERA) },
1596 { "SO3_LISPSM_SHADOW_CAMERA", TYPVAR, "I", SCOL_TYPTYPE(SO3_LISPSM_SHADOW_CAMERA) },
1597 { "SO3_SHADOWS_PRESET_NONE", TYPVAR, "I", SCOL_TYPTYPE(SShadowManager::SO3_SHADOWS_NONE) },
1598 { "SO3_SHADOWS_PRESET_STENCIL", TYPVAR, "I", SCOL_TYPTYPE(SShadowManager::SO3_SHADOWS_STENCIL) },
1599 { "SO3_SHADOWS_PRESET_LISPSM", TYPVAR, "I", SCOL_TYPTYPE(SShadowManager::SO3_SHADOWS_LISPSM) },
1600 { "SO3_SHADOWS_PRESET_CSM", TYPVAR, "I", SCOL_TYPTYPE(SShadowManager::SO3_SHADOWS_CSM) },
1601 { "SO3_SHADOWS_PRESET_PSSM", TYPVAR, "I", SCOL_TYPTYPE(SShadowManager::SO3_SHADOWS_PSSM) },
1602 { "SO3_SHADOWS_PRESET_DEFERRED", TYPVAR, "I", SCOL_TYPTYPE(SShadowManager::SO3_SHADOWS_DEFERRED) },
1603 { "SO3_ADDITIVE_SHADOWS_PRESET_TECHNIQUE", TYPVAR, "I", SCOL_TYPTYPE(SShadowManager::SO3_ADDITIVE_SHADOWS_LIGHTING) },
1604 { "SO3_MODULATIVE_SHADOWS_PRESET_TECHNIQUE", TYPVAR, "I", SCOL_TYPTYPE(SShadowManager::SO3_MODULATIVE_SHADOWS_LIGHTING) },
1605 { "SO3_SHADOWS_QUALITY_VERYLOW", TYPVAR, "I", SCOL_TYPTYPE(SShadowManager::SO3_SHADOWS_QUALITY_VERYLOW) },
1606 { "SO3_SHADOWS_QUALITY_LOW", TYPVAR, "I", SCOL_TYPTYPE(SShadowManager::SO3_SHADOWS_QUALITY_LOW) },
1607 { "SO3_SHADOWS_QUALITY_MEDIUM", TYPVAR, "I", SCOL_TYPTYPE(SShadowManager::SO3_SHADOWS_QUALITY_MEDIUM) },
1608 { "SO3_SHADOWS_QUALITY_HIGH", TYPVAR, "I", SCOL_TYPTYPE(SShadowManager::SO3_SHADOWS_QUALITY_HIGH) },
1609 { "SO3_SHADOWS_QUALITY_VERYHIGH", TYPVAR, "I", SCOL_TYPTYPE(SShadowManager::SO3_SHADOWS_QUALITY_VERYHIGH) },
1610 { "SO3SceneSetShadowColor", 2, "fun [SO3_SCENE I] I", SO3SceneSetShadowColor },
1611 { "SO3SceneGetShadowColor", 1, "fun [SO3_SCENE] I", SO3SceneGetShadowColor },
1612 { "SO3SceneSetSelfShadowTexture", 2, "fun [SO3_SCENE I] I", SO3SceneSetSelfShadowTexture },
1613 { "SO3SceneSetShadowTextureCount", 2, "fun [SO3_SCENE I] I", SO3SceneSetShadowTextureCount },
1614 { "SO3SceneSetShadowTextureSize", 2, "fun [SO3_SCENE I] I", SO3SceneSetShadowTextureSize },
1615 { "SO3SceneGetShadowTextureSize", 1, "fun [SO3_SCENE] I", SO3SceneGetShadowTextureSize },
1616 { "SO3SceneSetDefaultShadowCamera", 1, "fun [SO3_SCENE] I", SO3SceneSetDefaultShadowCamera },
1617 { "SO3SceneSetFocusedShadowCamera", 1, "fun [SO3_SCENE] I", SO3SceneSetFocusedShadowCamera },
1618 { "SO3SceneSetLISPSMShadowCamera", 1, "fun [SO3_SCENE] I", SO3SceneSetLISPSMShadowCamera },
1619 { "SO3SceneSetPlaneShadowCamera", 3, "fun [SO3_SCENE [F F F] F] I", SO3SceneSetPlaneShadowCamera },
1620 { "SO3SceneSetShadowDirectionalLightExtrusionDistance", 2, "fun [SO3_SCENE F] I", SO3SceneSetShadowDirectionalLightExtrusionDistance },
1621 { "SO3SceneSetShadowFarDistance", 2, "fun [SO3_SCENE F] I", SO3SceneSetShadowFarDistance },
1622 { "SO3SceneSetShadowTextureFadeStart", 2, "fun [SO3_SCENE F] I", SO3SceneSetShadowTextureFadeStart },
1623 { "SO3SceneGetShadowTextureFadeStart", 1, "fun [SO3_SCENE] F", SO3SceneGetShadowTextureFadeStart },
1624 { "SO3SceneGetShadowTechnique", 1, "fun [SO3_SCENE] I", SO3SceneGetShadowTechnique },
1625 { "SO3SceneSetShadowTextureFadeEnd", 2, "fun [SO3_SCENE F] I", SO3SceneSetShadowTextureFadeEnd },
1626 { "SO3SceneGetShadowTextureFadeEnd", 1, "fun [SO3_SCENE] F", SO3SceneGetShadowTextureFadeEnd },
1627 { "SO3SceneSetShadowDirLightTextureOffset", 2, "fun [SO3_SCENE F] I", SO3SceneSetShadowDirLightTextureOffset },
1628 { "SO3SceneGetSelfShadowTexture", 1, "fun [SO3_SCENE] I", SO3SceneGetSelfShadowTexture },
1629 { "SO3SceneGetShadowCameraSetup", 1, "fun [SO3_SCENE] I", SO3SceneGetShadowCameraSetup },
1630 { "SO3SceneGetShadowDirectionalLightExtrusionDistance", 1, "fun [SO3_SCENE] F", SO3SceneGetShadowDirectionalLightExtrusionDistance },
1631 { "SO3SceneGetShadowFarDistance", 1, "fun [SO3_SCENE] F", SO3SceneGetShadowFarDistance },
1632 { "SO3SceneGetShadowDirLightTextureOffset", 1, "fun [SO3_SCENE] F", SO3SceneGetShadowDirLightTextureOffset },
1633 { "SO3SceneGetShadowTextureCount", 1, "fun [SO3_SCENE] I", SO3SceneGetShadowTextureCount },
1634 { "SO3SceneSetShadowTechnique", 2, "fun [SO3_SCENE I] I", SO3SceneSetShadowTechnique },
1635 { "SO3SceneSetShadowCaster", 2, "fun [SO3_SCENE S] I", SO3SceneSetShadowCaster },
1636 { "SO3SceneSetShadowReceiver", 2, "fun [SO3_SCENE S] I", SO3SceneSetShadowReceiver },
1637 { "SO3SceneGetShadowCaster", 1, "fun [SO3_SCENE] S", SO3SceneGetShadowCaster },
1638 { "SO3SceneGetShadowReceiver", 1, "fun [SO3_SCENE] S", SO3SceneGetShadowReceiver },
1639 { "SO3SceneGetShadowPreset", 1, "fun [SO3_SCENE] I", SO3SceneGetShadowPreset },
1640 { "SO3SceneSetShadowPreset", 2, "fun [SO3_SCENE I] I", SO3SceneSetShadowPreset },
1641 { "SO3SceneGetShadowLightingTechnique", 1, "fun [SO3_SCENE] I", SO3SceneGetShadowLightingTechnique },
1642 { "SO3SceneSetShadowLightingTechnique", 2, "fun [SO3_SCENE I] I", SO3SceneSetShadowLightingTechnique },
1643 { "SO3SceneGetShadowQuality", 1, "fun [SO3_SCENE] I", SO3SceneGetShadowQuality },
1644 { "SO3SceneSetShadowQuality", 2, "fun [SO3_SCENE I] I", SO3SceneSetShadowQuality }
1645};
1646
1647
1653int SCOLloadLighting(mmachine m, cbmachine w)
1654{
1655 return PKhardpak2(m, "SO3Lighting.pkg", sizeof(natSO3Lighting) / sizeof(natSO3Lighting[0]), natSO3Lighting);
1656}
1657
1658
1664{
1665 return 0;
1666}
1667
NativeDefinition natSO3Lighting[]
int SCOLfreeLighting()
free the SO3Engine Viewport function
int SCOLloadLighting(mmachine m, cbmachine w)
Load the SO3Engine Shadows functions.
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
SCOL_EXPORT int cbmachine w
Definition SO3SCOL.cpp:5150
int SO3SceneSetShadowLightingTechnique(mmachine m)
SO3SceneSetShadowLightingTechnique : function to set the shadows technique.
int SO3SceneGetShadowTextureCount(mmachine m)
SO3SceneGetShadowTextureCount : function to get the shadows texture count.
int SO3SceneSetShadowQuality(mmachine m)
SO3SceneSetShadowQuality : function to defines shadow quality to use with current shadow technique Th...
int SO3SceneSetLISPSMShadowCamera(mmachine m)
SO3SceneSetLISPSMShadowCamera : function to set LISPSM shadow camera.
int SO3SceneGetShadowQuality(mmachine m)
SO3SceneGetShadowQuality : function to get the shadow quality in use This works only with texture sha...
int SO3SceneGetSelfShadowTexture(mmachine m)
SO3SceneGetSelfShadowTexture : function to get the self shadow texture.
int SO3SceneSetShadowTechnique(mmachine m)
SO3SceneSetShadowTechnique : function to get the shadows technique.
int SO3SceneSetShadowReceiver(mmachine m)
SO3SceneSetShadowReceiver : function to defines shadows receiver.
int SO3SceneSetShadowPreset(mmachine m)
SO3SceneSetShadowPreset : function to defines a preset shadow subsystem to use.
int SO3SceneGetShadowTextureFadeEnd(mmachine m)
SO3SceneGetShadowTextureFadeEnd : function to get the shadows fade end distance.
int SO3SceneGetShadowReceiver(mmachine m)
SO3SceneGetShadowReceiver : function to retrieve shadows receiver.
int SO3SceneSetShadowFarDistance(mmachine m)
SO3SceneSetShadowFarDistance : function to defines distance maximum for shadows.
int SO3SceneSetShadowTextureSize(mmachine m)
SO3SceneSetShadowTextureSize : function to defines shadow texture size.
int SO3SceneSetShadowColor(mmachine m)
SO3SceneSetShadowColor : function to defines shadow color of the scene.
int SO3SceneSetDefaultShadowCamera(mmachine m)
SO3SceneSetDefaultShadowCamera : function to defines default shadow camera.
int SO3SceneSetShadowTextureCount(mmachine m)
SO3SceneSetShadowTextureCount : function to defines shadow texture count in the scene.
int SO3SceneGetShadowTechnique(mmachine m)
SO3SceneGetShadowTechnique : function to defines technique for shadows.
int SO3SceneSetShadowDirLightTextureOffset(mmachine m)
SO3SceneSetShadowDirLightTextureOffset : function to defines texture offset.
int SO3SceneSetShadowTextureFadeEnd(mmachine m)
SO3SceneSetShadowTextureFadeEnd : function to defines fade end distance for shadows.
int SO3SceneSetShadowDirectionalLightExtrusionDistance(mmachine m)
SO3SceneSetShadowDirectionalLightExtrusionDistance : function to defines shadow directional light ext...
int SO3SceneGetShadowDirLightTextureOffset(mmachine m)
SO3SceneGetShadowDirLightTextureOffset : function to get the shadows direction light texture offset.
int SO3SceneSetShadowTextureFadeStart(mmachine m)
SO3SceneSetShadowTextureFadeStart : function to defines fade start distance for shadows.
int SO3SceneGetShadowTextureSize(mmachine m)
SO3SceneGetShadowTextureSize : function to get the shadow texture size.
int SO3SceneSetFocusedShadowCamera(mmachine m)
SO3SceneSetFocusedShadowCamera : function to set focused shadow camera.
int SO3SceneGetShadowTextureFadeStart(mmachine m)
SO3SceneGetShadowTextureFadeStart : function to get the shadows fade start distance.
int SO3SceneGetShadowPreset(mmachine m)
SO3SceneGetShadowPreset : function to get the shadow subsystem in use.
int SO3SceneGetShadowCameraSetup(mmachine m)
SO3SceneGetShadowCameraSetup : function to get the shadow camera setup mode.
int SO3SceneSetShadowCaster(mmachine m)
SO3SceneSetShadowCaster : function to defines shadows caster.
int SO3SceneGetShadowFarDistance(mmachine m)
SO3SceneGetShadowFarDistance : function to get the shadows far distance.
int SO3SceneSetPlaneShadowCamera(mmachine m)
SO3SceneSetPlaneShadowCamera : function to set Plane shadow camera.
int SO3SceneGetShadowColor(mmachine m)
SO3SceneGetShadowColor : function to get the shadow color of the scene.
int SO3SceneGetShadowDirectionalLightExtrusionDistance(mmachine m)
SO3SceneGetShadowDirectionalLightExtrusionDistance : function to get the shadows direction light extr...
int SO3SceneGetShadowLightingTechnique(mmachine m)
SO3SceneGetShadowLightingTechnique : function to get technique for shadows.
int SO3SceneSetSelfShadowTexture(mmachine m)
SO3SceneSetSelfShadowTexture : function to defines self shadow texture.
int SO3SceneGetShadowCaster(mmachine m)
SO3SceneGetShadowCaster : function to retrieve shadows caster material name.