CHAPITRE 1 : généralités |
|
---|---|
PreambleThe target of this library is to provide a shadow system for blitz3d in order to do scenery. The name of the library is GOM G = Gestion ( management) OM = Ombres ( shadow) This library can not replace a light mapping tool or a professional system. It is just a simple shadow library for BLITZ3D. Please read carefully the recommendations before to start a project with this library. This library is under GPL licence. You can use as you want : for commercial or non commercial project.
If you improve it please send the update to Philippe C. |
PréambuleLe but de cette librairie est de proposer un système d'ombre pour Blitz3D dans le cadre de scène. Le nom de cette librairie est GOM G = Gestion ( management) OM = Ombres ( shadow) Cette librairie ne peut remplacer un light maper ou un système professionnel. Il s'agit juste d'une simple librairie d'ombre pour BLITZ3D. Veuillez lire attentivement les recomendations avant de commencer un projet avec cette librairie. Cette librairie est dans le domaine gratuit. Vous pouvez l'utiliser comme vous le souhaitez, pour un projet commercial ou non.
Si vous souhaitez l'améliorer, veuillez adresser la mise à jour à Philippe C. |
RecommendationsUse this library to manage shadow in a small scenery :
This is the ground , mountain, house where your character will move.
This object could be : other characters, car, tree (with wind) ...
Have a look on the demo to understand what is feasible with this library. |
RecommendationsUtilisez cette librairie pour utiliser les ombres dans de petite scène :
Il s'agit du sol, montagnes, maison... Où vos personnages vont se déplacer.
Ces objets peuvent être : autre personnage, voiture, arbres (avec le vent) ...
Regardez les démo pour comprendre ce qui est faisable avec cette librairie. |
How to proceed if you are a novice with GOM ?
When you have a playable scenery you can implement the shadow with GOM
Note : if you are not able to do the step 1 & 2 don't try the step 3 . Use the demo and 3D model provided to understand what 3D model means. And understand how a playable scenery is done . When you are able to update the demo and get the expected result . At this step you can use GOM in you own playable scenery. |
Comment procéder si vous êtes un novice avec GOM ?
Lorsque vous avez une scène jouable vous pouvez implémenter les ombres avec GOM
Note : si vous n'êtes pas capable de faire les étapes 1&2 il est inutile de faire l'étape 3. Utilisez les démo et les modèles 3D fournit pour comprendre ce qui signifie modèle 3D. Et comprenez comment une scène jouable est faite. Lorsque vous êtes capable de modifier les démos et d'obtenir le résultat escompté, vous pouvez utiliser GOM dans vos propre scène.
|
All the generalities above are detailed in next chapters |
Toutes les généralités ci dessus sont détaillées dans les chapitres suivants. |
CHAPTER 2 : Design the scenery |
CHAPITRE 2 : concevoir la scène |
---|---|
TBD |
A FAIRE |
CHAPTER 3 : Build you scenery |
CHAPITRE 3 : Construire la scène |
---|---|
TBD |
A FAIRE |
CHAPTER 4 : Add GOM_BLITZ3D command |
CHAPITRE 4 : Ajouter les commandes GOM_BLITZ3D |
---|---|
Animate CameraRange CopyMesh CreateCamera CreateCone CreateCube CreateCylinder CreateLight CreateMesh CreateSphere FreeEntity LightColor LightConeAngles LightRange LoadAnimMesh LoadBSP LoadMesh LoadMD2 MeshWidth MeshHeight MeshDepth ScaleEntity ScaleMesh For the 3D objects with shadows done with light mapper do not add the 'GOM_' prefix.
GOM_sceneCreate : in order to identify the scenery Or set optional parameter in order to improve the shadow generation : reference chapter 5 and demoxx
GOM_scenePrepare(startScene)
... UpdateWorld() ... GOM_sceneShadow(player,camera) ... RenderWorld ... |
Animate CameraRange CopyMesh CreateCamera CreateCone CreateCube CreateCylinder CreateLight CreateMesh CreateSphere FreeEntity LightColor LightConeAngles LightRange LoadAnimMesh LoadBSP LoadMesh LoadMD2 MeshWidth MeshHeight MeshDepth ScaleEntity ScaleMesh Pour les objets 3D ayant leurs ombres faites par light mapper ne pas utiliser le préfixe 'GOM_'.
GOM_scenePrepare(startScene)
... UpdateWorld() ... GOM_sceneShadow(player,camera) ... RenderWorld ... |
CHAPTER 5 : advanced GOM functions |
CHAPITRE 5 |
---|---|
GOM_sceneCreate(object3d%,red%,green%,blue%) : mandatoryThis function should be used to identify the ground where the character/player walk, run. It is possible to have several ground in the same scenery . For instance a land and a house with several floor ( see demo04.bb ). These objects will be called in the documentation scenery Object3d : unique blitz identifier returned by the function GOM_... used to create or load a 3D object . Red,green,blue : colour of the ambient light |
GOM_sceneCreate(object3d%,red%,green%,blue%) : obligatoireCette fonction doit être utilisée pour identifier le sol ou le joueur/personnage marche, cour. Il est possible d'avoir plusieurs sol dans la même scène. Par exemple un paysage et une maison ayant plusieurs niveau (voir démo04.bb) Ces objets seront appelés dans la documentation de la scène. Object3d : identifiant unique blitz retourné par les fonctions GOM_... utilisées pour créer ou charger des objets 3D. Red,green,blue : couleur de la lumière ambiante. |
GOM_sceneObjectAll(object3d%) : mandatoryThis function should be used in order to identify the object which can move between different scene , for instance : the player Object3d : unique blitz identifier returned by the function GOM_... used to create or load a 3D object . |
GOM_sceneObjectAll(object3d%) : obligatoireCette fonction doit être utilisé afin d'identifier les objets pouvant se dépacer d'une scène à l'autre, par exemple : le joueur. Object3d : identifiant unique blitz retourné par les fonctions GOM_... utilisées pour créer ou charger des objets 3D. |
GOM_scenePrepare(object3d%) : mandatoryThis function prepare the sceneries in order to optimise the shadow computation and check if all the scenery is consistent. This should be done in order to identify the starting point of the player. On which place the player is. If an error is detected an error message will be displayed and the program stop. Object3d : unique blitz identifier returned by the function GOM_... used by the function GOM_sceneCreate(object3d). |
GOM_scenePrepare(object3d%) : obligatoireCette fonction prepare la scène afin d'optimiser le calcul d'ombre et vérifie si la scène est cohérente. Elle doit être appelée afin de déterminer le point de départ du joueur, dans quel scène je joueur est. Si une erreur est détectée un message d'erreur s'affichera et le programme s'arrêtera. Object3d : identifiant unique blitz retourné par les fonctions GOM_... utilisées pour créer ou charger des objets 3D. |
GOM_sceneShadow(collision%,player%,camera%) : mandatoryThis function computes the shadows for all the sceneries. Collision is the blitz3D identiifer of the pivot used to manage the collision Player is the blitzt3D identifier of the main character under the player control. Camera is the blitzt3D identifier of camera used in the scenery. |
GOM_sceneShadow(collision%,player%,camera%) : obligatoireCette fonction calcule les ombres pour toutes les scènes. Collision est l'identifiant Blitz3D du pivot utilisé pour gérer les collisions. Player est l'identifiant Blitz3D du personnage principale sous le controle du joueur. Camera est l'identifiant Blitz3D de la camera utilisée dans la scène. |
GOM_textureSize(idobject%,size%) : optionalThis function change the texture size of an object created with the GOM functions relatives to the 3D object creation ( see chapter 4 for more information) idObject : is the unique blitz identifier of an 3D object created or loaded with the GOM_BLITZ3D functions. Size : is the texture size use to render the shadow , by default it is set to 128. The texture size could be 64,128,256 , you can use more but the performance will be really poor. The best compromise is 128 |
GOM_textureSize(idobject%,size%) : optionnelCette fonction change la taille de la texture d'un objet crée avec les fonctions GOM relatives à la création des objets 3D (voir chapitre 4 pour plus d'information) idObject : identifiant unique Blitz d'un objet 3D crée ou chargé avec les fonctions GOM_BLITZ3D Size : taille de la texture utilisée pour rendre l'ombre, initialisé par défaut à 128. La taille de la texture peut être 64, 128, 256, le plus grand, le plus lent ce sera. Le meilleur compromis est 128. |
GOM_zoomSize(idobject%,zoom#) : optionalThis function change the zoom of the camera of a shadowed object created with the GOM functions relatives to the 3D object creation ( see GOM_BLITZ3D function for more information) idObject : is the unique blitz identifier of an 3D object created or loaded with the GOM_BLITZ3D functions. Zoom : is a real number used to set the zoom , star at 0.1 to see the result and decrease the value until the shadow is complete. |
|
GOM_lightHeigthMin(idlight,yMin%) : optionalThis function set the minimum hight of the light when the light move , by default it is the y position of the light when the game start idlight : identifier of the light created with GOM_CreateLight yMin : minimum hight of the light when the light move , for instance at sunrise or at sunset. See demo 3 for more information |
|
GOM_sceneTitle(idObject%,title$) : optionalThis function could be used in order to give a title to the object , this title is displayed when an error occurs ( see debuglog or blocking message) |
|
GOM_lightShadowMin(idLight%,light) : optionalThis function could be used to tune the shadow darkness of the a light. By default the value is set to 200. idlight : identifier of the light created with GOM_CreateLight light : intensity of the shadow , if the value is equal to 0 the shadow will be fully dark . If the value is closed from 255 the shadow will be light grey.. |
|
GOM_shadowheight(idObject%,height%) : optionalThis function should be used in closed environment in order to avoid that the shadow is displayed on the ceil. idObject : is the unique blitz identifier of an 3D object created or loaded with the GOM_BLITZ3D functions. Height : is a number used to set the maximum height of a shadow when the shadow is projected on a wall for instance or a vertical object in general. |
|
GOM_sceneObjectSurface(idobject,surface) : optionalThis function should be used when a scene is composed with several surfaces ( but default only the 1st one is taken into account) idObject : is the unique blitz identifier of an 3D object created or loaded with the GOM_BLITZ3D functions. Surface : number of the surface used to compute and project the shadow |
. |
GOM_shadowTime(idobject,time) : optionalThis function should be used when the generation of the shadow is too slowed or too fast (performance) idObject : is the unique blitz identifier of an 3D object created or loaded with the GOM_BLITZ3D functions. Time : time in milliseconds . During this period of time the shadow is not computed , by default it is set to 200 milliseconds. 10 milliseconds should used in order to get a very good result. To use with the player or object moving very often. |
|
GOM_shadowNO(idobject1,idobject2) : optionalThis function should be used when parasite projected shadows appear or to improve general performance of projected shadows. The shadow of the object1 is never projected on the object2. idObject1, idObject2 : are the unique blitz identifier of an 3D object created or loaded with the GOM_BLITZ3D functions. In order to better understand the use of this command put in comment the lines with this command in the demo04.bb. |
|
GOM_objectCreate(file$,idObject,parent,control=true)This function could be used instead of the blitz command relative ti the 3D objet creation. CopyMesh, CreateCone ,CreateCube, CreateCylinder, CreateMesh, CreateSphere, LoadAnimMesh, LoadBSP, LoadMesh, LoadMD2. file : name of the file used to load the 3D object it is manadatory to compute correctly the meshHeight, the mesWidth and the meshDepth. idObject : is the unique blitz identifier of an 3D object created or loaded with the GOM_BLITZ3D functions. Parent : s the unique blitz identifier of a parent object created BLITZ3D functions. Control : if true the file$ is contolled if false no control are done. |
|
GOM_objectDelete(idObject)This function could be used instead of the blitz command freeentity , if the command GOM_objectCreate is used , this command should be used. idObject : is the unique blitz identifier of an 3D object created or loaded with the GOM_BLITZ3D functions. |
|
The GOM_api_... : should not be used , it can change in the next release of the library. |
|