Added FX Materials
* Added FX Shader Materials * Added Projector Actor
This commit is contained in:
17
doc/doc_files/converttonormalmap.html
Normal file
17
doc/doc_files/converttonormalmap.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>ConvertToNormalMap [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>sub ConvertToNormalMap(img_id, amp) </h2></p>
|
||||
<p>
|
||||
Converts an image to a format for normal maps
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,6 +9,9 @@
|
||||
<body>
|
||||
<p><h2>Function CreateConeMesh( radius, cone_length, tesselation, top_color, bottom_color ) </h2></p>
|
||||
<p>
|
||||
Create a cone mesh
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,6 +9,9 @@
|
||||
<body>
|
||||
<p><h2>Function CreateCylinderMesh( radius, cylinder_length, tesselation, color, close_top ) </h2></p>
|
||||
<p>
|
||||
Create a cylinder mesh
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
20
doc/doc_files/createprojectoractor.html
Normal file
20
doc/doc_files/createprojectoractor.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>CreateProjectorActor [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>Function CreateProjectorActor() </h2></p>
|
||||
<p>
|
||||
Create a projector actor.
|
||||
</p>
|
||||
<p>
|
||||
Projector actors can be used to project a texture over objects in its field of view.
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,6 +9,9 @@
|
||||
<body>
|
||||
<p><h2>Function CreateVolumeLightMesh( u, v, foot_color, tail_color, lp_distance, dim_x, dim_y, dim_z ) </h2></p>
|
||||
<p>
|
||||
Create a mesh to represent a light volume.
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,6 +9,9 @@
|
||||
<body>
|
||||
<p><h2>Sub DeleteAN8( an8_project ) </h2></p>
|
||||
<p>
|
||||
Clears a anim8or project from program memory.
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
17
doc/doc_files/getgpuinfo.html
Normal file
17
doc/doc_files/getgpuinfo.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>GetGPUInfo$ [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>function GetGPUInfo$() </h2></p>
|
||||
<p>
|
||||
Returns the GPU Vendor info
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
20
doc/doc_files/getmaterialconstant.html
Normal file
20
doc/doc_files/getmaterialconstant.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>GetMaterialConstant [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>Sub GetMaterialConstant(material, m_constant$, ByRef n1, ByRef n2, ByRef n3, ByRef n4) </h2></p>
|
||||
<p>
|
||||
Gets the constant value of an FX material
|
||||
</p>
|
||||
<br><p>Related:
|
||||
<a href="setmaterialconstant.html">SetMaterialConstant</a>
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
23
doc/doc_files/getmaterialconstantname.html
Normal file
23
doc/doc_files/getmaterialconstantname.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>GetMaterialConstantName$ [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>Function GetMaterialConstantName$(material_type, index) </h2></p>
|
||||
<p>
|
||||
Returns the name of a uniform for an FX material type
|
||||
</p>
|
||||
<p>
|
||||
NOTE: index should be a number between 0 and NumMaterialConstants
|
||||
</p>
|
||||
<br><p>Related:
|
||||
<a href="nummaterialconstants.html">NumMaterialConstants</a>
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
20
doc/doc_files/getprojectorfov.html
Normal file
20
doc/doc_files/getprojectorfov.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>GetProjectorFOV [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>Function GetProjectorFOV(actor) </h2></p>
|
||||
<p>
|
||||
Returns the field of view for a projector
|
||||
</p>
|
||||
<br><p>Related:
|
||||
<a href="setprojectorfov.html">SetProjectorFOV</a>
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
20
doc/doc_files/getprojectortarget.html
Normal file
20
doc/doc_files/getprojectortarget.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>GetProjectorTarget [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>Sub GetProjectorTarget(actor, ByRef x, ByRef y, ByRef z) </h2></p>
|
||||
<p>
|
||||
Get the point a projector is looking at
|
||||
</p>
|
||||
<br><p>Related:
|
||||
<a href="setprojectortarget.html">SetProjectorTarget</a>
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
20
doc/doc_files/getsceneambientcolor.html
Normal file
20
doc/doc_files/getsceneambientcolor.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>GetSceneAmbientColor [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>Function GetSceneAmbientColor() </h2></p>
|
||||
<p>
|
||||
Returns the ambient light color of the scene
|
||||
</p>
|
||||
<br><p>Related:
|
||||
<a href="setsceneambientcolor.html">SetSceneAmbientColor</a>
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
20
doc/doc_files/getsceneshadowcolor.html
Normal file
20
doc/doc_files/getsceneshadowcolor.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>GetSceneShadowColor [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>Function GetSceneShadowColor() </h2></p>
|
||||
<p>
|
||||
Returns the shadow color of the scene
|
||||
</p>
|
||||
<br><p>Related:
|
||||
<a href="setsceneshadowcolor.html">SetSceneShadowColor</a>
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -665,6 +665,8 @@ ul, #myUL {
|
||||
|
||||
<li><a href="getantialiasmode.html" target="main">GetAntiAliasMode</a></li>
|
||||
|
||||
<li><a href="converttonormalmap.html" target="main">ConvertToNormalMap</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -1021,6 +1023,8 @@ ul, #myUL {
|
||||
|
||||
<li><a href="systemram.html" target="main">SystemRam</a></li>
|
||||
|
||||
<li><a href="getgpuinfo.html" target="main">GetGPUInfo$</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -1697,6 +1701,8 @@ ul, #myUL {
|
||||
|
||||
<li><a href="actorexists.html" target="main">ActorExists</a></li>
|
||||
|
||||
<li><a href="createprojectoractor.html" target="main">CreateProjectorActor</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -2163,6 +2169,14 @@ ul, #myUL {
|
||||
|
||||
<li><a href="clearscene.html" target="main">ClearScene</a></li>
|
||||
|
||||
<li><a href="setsceneshadowcolor.html" target="main">SetSceneShadowColor</a></li>
|
||||
|
||||
<li><a href="getsceneshadowcolor.html" target="main">GetSceneShadowColor</a></li>
|
||||
|
||||
<li><a href="setsceneambientcolor.html" target="main">SetSceneAmbientColor</a></li>
|
||||
|
||||
<li><a href="getsceneambientcolor.html" target="main">GetSceneAmbientColor</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
@@ -2334,6 +2348,22 @@ ul, #myUL {
|
||||
<li><a href="setterrainpatchlod.html" target="main">SetTerrainPatchLOD</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul id="myUL">
|
||||
<li><span class="box">Projector</span>
|
||||
<ul class="nested">
|
||||
<li><a href="setprojectortarget.html" target="main">SetProjectorTarget</a></li>
|
||||
|
||||
<li><a href="getprojectortarget.html" target="main">GetProjectorTarget</a></li>
|
||||
|
||||
<li><a href="setprojectorfov.html" target="main">SetProjectorFOV</a></li>
|
||||
|
||||
<li><a href="getprojectorfov.html" target="main">GetProjectorFOV</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -2459,6 +2489,14 @@ ul, #myUL {
|
||||
|
||||
<li><a href="materialexists.html" target="main">MaterialExists</a></li>
|
||||
|
||||
<li><a href="nummaterialconstants.html" target="main">NumMaterialConstants</a></li>
|
||||
|
||||
<li><a href="getmaterialconstantname.html" target="main">GetMaterialConstantName$</a></li>
|
||||
|
||||
<li><a href="setmaterialconstant.html" target="main">SetMaterialConstant</a></li>
|
||||
|
||||
<li><a href="getmaterialconstant.html" target="main">GetMaterialConstant</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
17
doc/doc_files/nummaterialconstants.html
Normal file
17
doc/doc_files/nummaterialconstants.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>NumMaterialConstants [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>Function NumMaterialConstants(material_type) </h2></p>
|
||||
<p>
|
||||
Returns the number of shader uniforms for an FX material
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
20
doc/doc_files/setmaterialconstant.html
Normal file
20
doc/doc_files/setmaterialconstant.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>SetMaterialConstant [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>Sub SetMaterialConstant(material, m_constant$, n1, n2, n3, n4) </h2></p>
|
||||
<p>
|
||||
Sets the constant value of an FX material
|
||||
</p>
|
||||
<br><p>Related:
|
||||
<a href="getmaterialconstant.html">GetMaterialConstant</a>
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
20
doc/doc_files/setprojectorfov.html
Normal file
20
doc/doc_files/setprojectorfov.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>SetProjectorFOV [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>Sub SetProjectorFOV(actor, fov) </h2></p>
|
||||
<p>
|
||||
Set the field of view for a projector
|
||||
</p>
|
||||
<br><p>Related:
|
||||
<a href="getprojectorfov.html">GetProjectorFOV</a>
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
17
doc/doc_files/setprojectortarget.html
Normal file
17
doc/doc_files/setprojectortarget.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>SetProjectorTarget [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>Sub SetProjectorTarget(actor, x, y, z) </h2></p>
|
||||
<p>
|
||||
Set the point a projector is pointed at
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
20
doc/doc_files/setsceneambientcolor.html
Normal file
20
doc/doc_files/setsceneambientcolor.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>SetSceneAmbientColor [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>Sub SetSceneAmbientColor(color) </h2></p>
|
||||
<p>
|
||||
Sets the ambient light color of the scene
|
||||
</p>
|
||||
<br><p>Related:
|
||||
<a href="getsceneambientcolor.html">GetSceneAmbientColor</a>
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
20
doc/doc_files/setsceneshadowcolor.html
Normal file
20
doc/doc_files/setsceneshadowcolor.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
||||
<title>SetSceneShadowColor [RCBasic Doc] </title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p><h2>Sub SetSceneShadowColor(color) </h2></p>
|
||||
<p>
|
||||
Sets the shadow color of the scene
|
||||
</p>
|
||||
<br><p>Related:
|
||||
<a href="getsceneshadowcolor.html">GetSceneShadowColor</a>
|
||||
</p>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
4
doc/files/converttonormalmap.txt
Normal file
4
doc/files/converttonormalmap.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
#title ConvertToNormalMap [RCBasic Doc]
|
||||
#header sub ConvertToNormalMap(img_id, amp)
|
||||
|
||||
Converts an image to a format for normal maps
|
||||
@@ -1,4 +1,4 @@
|
||||
#title CreateConeMesh [RCBasic Doc]
|
||||
#header Function CreateConeMesh( radius, cone_length, tesselation, top_color, bottom_color )
|
||||
|
||||
|
||||
Create a cone mesh
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#title CreateCylinderMesh [RCBasic Doc]
|
||||
#header Function CreateCylinderMesh( radius, cylinder_length, tesselation, color, close_top )
|
||||
|
||||
|
||||
Create a cylinder mesh
|
||||
|
||||
6
doc/files/createprojectoractor.txt
Normal file
6
doc/files/createprojectoractor.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
#title CreateProjectorActor [RCBasic Doc]
|
||||
#header Function CreateProjectorActor()
|
||||
|
||||
Create a projector actor.
|
||||
|
||||
Projector actors can be used to project a texture over objects in its field of view.
|
||||
@@ -1,4 +1,4 @@
|
||||
#title CreateVolumeLightMesh [RCBasic Doc]
|
||||
#header Function CreateVolumeLightMesh( u, v, foot_color, tail_color, lp_distance, dim_x, dim_y, dim_z )
|
||||
|
||||
|
||||
Create a mesh to represent a light volume.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#title DeleteAN8 [RCBasic Doc]
|
||||
#header Sub DeleteAN8( an8_project )
|
||||
|
||||
|
||||
Clears a anim8or project from program memory.
|
||||
|
||||
4
doc/files/getgpuinfo.txt
Normal file
4
doc/files/getgpuinfo.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
#title GetGPUInfo$ [RCBasic Doc]
|
||||
#header function GetGPUInfo$()
|
||||
|
||||
Returns the GPU Vendor info
|
||||
6
doc/files/getmaterialconstant.txt
Normal file
6
doc/files/getmaterialconstant.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
#title GetMaterialConstant [RCBasic Doc]
|
||||
#header Sub GetMaterialConstant(material, m_constant$, ByRef n1, ByRef n2, ByRef n3, ByRef n4)
|
||||
|
||||
Gets the constant value of an FX material
|
||||
|
||||
#ref SetMaterialConstant
|
||||
8
doc/files/getmaterialconstantname.txt
Normal file
8
doc/files/getmaterialconstantname.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
#title GetMaterialConstantName$ [RCBasic Doc]
|
||||
#header Function GetMaterialConstantName$(material_type, index)
|
||||
|
||||
Returns the name of a uniform for an FX material type
|
||||
|
||||
NOTE: index should be a number between 0 and NumMaterialConstants
|
||||
|
||||
#ref NumMaterialConstants
|
||||
6
doc/files/getprojectorfov.txt
Normal file
6
doc/files/getprojectorfov.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
#title GetProjectorFOV [RCBasic Doc]
|
||||
#header Function GetProjectorFOV(actor)
|
||||
|
||||
Returns the field of view for a projector
|
||||
|
||||
#ref SetProjectorFOV
|
||||
6
doc/files/getprojectortarget.txt
Normal file
6
doc/files/getprojectortarget.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
#title GetProjectorTarget [RCBasic Doc]
|
||||
#header Sub GetProjectorTarget(actor, ByRef x, ByRef y, ByRef z)
|
||||
|
||||
Get the point a projector is looking at
|
||||
|
||||
#ref SetProjectorTarget
|
||||
6
doc/files/getsceneambientcolor.txt
Normal file
6
doc/files/getsceneambientcolor.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
#title GetSceneAmbientColor [RCBasic Doc]
|
||||
#header Function GetSceneAmbientColor()
|
||||
|
||||
Returns the ambient light color of the scene
|
||||
|
||||
#ref SetSceneAmbientColor
|
||||
6
doc/files/getsceneshadowcolor.txt
Normal file
6
doc/files/getsceneshadowcolor.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
#title GetSceneShadowColor [RCBasic Doc]
|
||||
#header Function GetSceneShadowColor()
|
||||
|
||||
Returns the shadow color of the scene
|
||||
|
||||
#ref SetSceneShadowColor
|
||||
4
doc/files/nummaterialconstants.txt
Normal file
4
doc/files/nummaterialconstants.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
#title NumMaterialConstants [RCBasic Doc]
|
||||
#header Function NumMaterialConstants(material_type)
|
||||
|
||||
Returns the number of shader uniforms for an FX material
|
||||
6
doc/files/setmaterialconstant.txt
Normal file
6
doc/files/setmaterialconstant.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
#title SetMaterialConstant [RCBasic Doc]
|
||||
#header Sub SetMaterialConstant(material, m_constant$, n1, n2, n3, n4)
|
||||
|
||||
Sets the constant value of an FX material
|
||||
|
||||
#ref GetMaterialConstant
|
||||
6
doc/files/setprojectorfov.txt
Normal file
6
doc/files/setprojectorfov.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
#title SetProjectorFOV [RCBasic Doc]
|
||||
#header Sub SetProjectorFOV(actor, fov)
|
||||
|
||||
Set the field of view for a projector
|
||||
|
||||
#ref GetProjectorFOV
|
||||
4
doc/files/setprojectortarget.txt
Normal file
4
doc/files/setprojectortarget.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
#title SetProjectorTarget [RCBasic Doc]
|
||||
#header Sub SetProjectorTarget(actor, x, y, z)
|
||||
|
||||
Set the point a projector is pointed at
|
||||
6
doc/files/setsceneambientcolor.txt
Normal file
6
doc/files/setsceneambientcolor.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
#title SetSceneAmbientColor [RCBasic Doc]
|
||||
#header Sub SetSceneAmbientColor(color)
|
||||
|
||||
Sets the ambient light color of the scene
|
||||
|
||||
#ref GetSceneAmbientColor
|
||||
6
doc/files/setsceneshadowcolor.txt
Normal file
6
doc/files/setsceneshadowcolor.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
#title SetSceneShadowColor [RCBasic Doc]
|
||||
#header Sub SetSceneShadowColor(color)
|
||||
|
||||
Sets the shadow color of the scene
|
||||
|
||||
#ref GetSceneShadowColor
|
||||
@@ -43,4 +43,5 @@ Include "/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/particles.bas"
|
||||
Include "/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/lights.bas"
|
||||
Include "/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/terrain.bas"
|
||||
Include "/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/water.bas"
|
||||
Include "/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/projector.bas"
|
||||
Include "/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_lib/materials.bas"
|
||||
|
||||
@@ -246,6 +246,7 @@ rc_drawImage_Flip( DRAWIMAGE_FLIP_SLOT, DRAWIMAGE_FLIP_X, DRAWIMAGE_FLIP_Y, D
|
||||
rc_drawImage_FlipEx( DRAWIMAGE_FLIPEX_SLOT, DRAWIMAGE_FLIPEX_X, DRAWIMAGE_FLIPEX_Y, DRAWIMAGE_FLIPEX_SRC_X, DRAWIMAGE_FLIPEX_SRC_Y, DRAWIMAGE_FLIPEX_SRC_W, DRAWIMAGE_FLIPEX_SRC_H, DRAWIMAGE_FLIPEX_H, DRAWIMAGE_FLIPEX_V )
|
||||
rc_setAntiAliasMode( SETANTIALIASMODE_AA_MODE )
|
||||
rc_getAntiAliasMode( )
|
||||
rc_convertToNormalMap( CONVERTTONORMALMAP_IMG_ID, CONVERTTONORMALMAP_AMP )
|
||||
rc_inKey( )
|
||||
rc_key( KEY_KEY_CODE )
|
||||
rc_waitKey( )
|
||||
@@ -392,6 +393,7 @@ rc_messageBox( MESSAGEBOX_TITLE$, MESSAGEBOX_MSG$ )
|
||||
#/home/n00b/Projects/RCBASIC4/rcbasic_build/intern_inc/exceptions/rc_runtime.h
|
||||
rc_numCPUs( )
|
||||
rc_intern_systemRam( )
|
||||
rc_getGPUInfo( )
|
||||
rc_dimMatrix( DIMMATRIX_M_ROWS, DIMMATRIX_M_COLS )
|
||||
rc_deleteMatrix( DELETEMATRIX_MA )
|
||||
rc_addMatrix( ADDMATRIX_MA, ADDMATRIX_MB, ADDMATRIX_MC )
|
||||
@@ -690,6 +692,7 @@ rc_getActorAutoCulling( GETACTORAUTOCULLING_ACTOR )
|
||||
rc_addActorShadow( ADDACTORSHADOW_ACTOR )
|
||||
rc_removeActorShadow( REMOVEACTORSHADOW_ACTOR )
|
||||
rc_actorExists( ACTOREXISTS_ACTOR )
|
||||
rc_createProjectorActor( )
|
||||
rc_createActorAnimation( CREATEACTORANIMATION_ACTOR, CREATEACTORANIMATION_START_FRAME, CREATEACTORANIMATION_END_FRAME, CREATEACTORANIMATION_SPEED )
|
||||
rc_setActorAnimation( SETACTORANIMATION_ACTOR, SETACTORANIMATION_ANIMATION, SETACTORANIMATION_NUM_LOOPS )
|
||||
rc_setActorAnimationSpeed( SETACTORANIMATIONSPEED_ACTOR, SETACTORANIMATIONSPEED_ANIMATION, SETACTORANIMATIONSPEED_SPEED )
|
||||
@@ -903,6 +906,10 @@ rc_getWorld3DTimeStep( )
|
||||
rc_setSceneFog( SETSCENEFOG_COLOR, SETSCENEFOG_FOG_TYPE, SETSCENEFOG_START_VAL, SETSCENEFOG_END_VAL, SETSCENEFOG_DENSITY, SETSCENEFOG_PIXELFOG, SETSCENEFOG_RANGEFOG )
|
||||
rc_getSceneFog( &GETSCENEFOG_COLOR, &GETSCENEFOG_FOG_TYPE, &GETSCENEFOG_START_VAL, &GETSCENEFOG_END_VAL, &GETSCENEFOG_DENSITY, &GETSCENEFOG_PIXELFOG, &GETSCENEFOG_RANGEFOG )
|
||||
rc_clearScene( )
|
||||
rc_setSceneShadowColor( SETSCENESHADOWCOLOR_COLOR )
|
||||
rc_getSceneShadowColor( )
|
||||
rc_setSceneAmbientColor( SETSCENEAMBIENTCOLOR_COLOR )
|
||||
rc_getSceneAmbientColor( )
|
||||
rc_startParticleEmitter( STARTPARTICLEEMITTER_ACTOR )
|
||||
rc_stopParticleEmitter( STOPPARTICLEEMITTER_ACTOR )
|
||||
rc_setParticleDirection( SETPARTICLEDIRECTION_ACTOR, SETPARTICLEDIRECTION_X, SETPARTICLEDIRECTION_Y, SETPARTICLEDIRECTION_Z )
|
||||
@@ -976,6 +983,10 @@ rc_scaleTerrainTexture( SCALETERRAINTEXTURE_ACTOR, SCALETERRAINTEXTURE_SCALE,
|
||||
rc_setTerrainCameraMovementDelta( SETTERRAINCAMERAMOVEMENTDELTA_ACTOR, SETTERRAINCAMERAMOVEMENTDELTA_DELTA )
|
||||
rc_setTerrainCameraRotationDelta( SETTERRAINCAMERAROTATIONDELTA_ACTOR, SETTERRAINCAMERAROTATIONDELTA_DELTA )
|
||||
rc_setTerrainPatchLOD( SETTERRAINPATCHLOD_ACTOR, SETTERRAINPATCHLOD_PATCHX, SETTERRAINPATCHLOD_PATCHZ, SETTERRAINPATCHLOD_LOD )
|
||||
rc_setProjectorTarget( SETPROJECTORTARGET_ACTOR, SETPROJECTORTARGET_X, SETPROJECTORTARGET_Y, SETPROJECTORTARGET_Z )
|
||||
rc_getProjectorTarget( GETPROJECTORTARGET_ACTOR, &GETPROJECTORTARGET_X, &GETPROJECTORTARGET_Y, &GETPROJECTORTARGET_Z )
|
||||
rc_setProjectorFOV( SETPROJECTORFOV_ACTOR, SETPROJECTORFOV_FOV )
|
||||
rc_getProjectorFOV( GETPROJECTORFOV_ACTOR )
|
||||
rc_createMaterial( )
|
||||
rc_deleteMaterial( DELETEMATERIAL_MATERIAL_ID )
|
||||
rc_setActorMaterial( SETACTORMATERIAL_ACTOR, SETACTORMATERIAL_MATERIAL_NUM, SETACTORMATERIAL_MATERIAL_ID )
|
||||
@@ -1035,3 +1046,7 @@ rc_getActorMaterialFlag( GETACTORMATERIALFLAG_ACTOR, GETACTORMATERIALFLAG_MAT
|
||||
rc_setActorMaterialType( SETACTORMATERIALTYPE_ACTOR, SETACTORMATERIALTYPE_MATERIAL_TYPE )
|
||||
rc_getActorMaterialType( GETACTORMATERIALTYPE_ACTOR, GETACTORMATERIALTYPE_MATERIAL )
|
||||
rc_materialExists( MATERIALEXISTS_MATERIAL )
|
||||
rc_numMaterialConstants( NUMMATERIALCONSTANTS_MATERIAL_TYPE )
|
||||
rc_getMaterialConstantName( GETMATERIALCONSTANTNAME$_MATERIAL_TYPE, GETMATERIALCONSTANTNAME$_INDEX )
|
||||
rc_setMaterialConstant( SETMATERIALCONSTANT_MATERIAL, SETMATERIALCONSTANT_M_CONSTANT$, SETMATERIALCONSTANT_N1, SETMATERIALCONSTANT_N2, SETMATERIALCONSTANT_N3, SETMATERIALCONSTANT_N4 )
|
||||
rc_getMaterialConstant( GETMATERIALCONSTANT_MATERIAL, GETMATERIALCONSTANT_M_CONSTANT$, &GETMATERIALCONSTANT_N1, &GETMATERIALCONSTANT_N2, &GETMATERIALCONSTANT_N3, &GETMATERIALCONSTANT_N4 )
|
||||
|
||||
@@ -26,3 +26,4 @@ function GetActorAutoCulling( actor )
|
||||
sub AddActorShadow( actor )
|
||||
sub RemoveActorShadow( actor )
|
||||
function ActorExists( actor )
|
||||
Function CreateProjectorActor()
|
||||
|
||||
@@ -29,3 +29,4 @@ sub DrawImage_Flip(slot, x, y, h, v)
|
||||
sub DrawImage_FlipEx(slot, x, y, src_x, src_y, src_w, src_h, h, v)
|
||||
sub SetAntiAliasMode( aa_mode )
|
||||
function GetAntiAliasMode( )
|
||||
sub ConvertToNormalMap(img_id, amp)
|
||||
|
||||
@@ -57,3 +57,7 @@ function getActorMaterialFlag( actor, material, flag)
|
||||
sub setActorMaterialType( actor, material_type)
|
||||
function getActorMaterialType( actor, material)
|
||||
function MaterialExists( material )
|
||||
Function NumMaterialConstants(material_type)
|
||||
Function GetMaterialConstantName$(material_type, index)
|
||||
Sub SetMaterialConstant(material, m_constant$, n1, n2, n3, n4)
|
||||
Sub GetMaterialConstant(material, m_constant$, ByRef n1, ByRef n2, ByRef n3, ByRef n4)
|
||||
|
||||
4
rcbasic_build/intern_lib/projector.bas
Normal file
4
rcbasic_build/intern_lib/projector.bas
Normal file
@@ -0,0 +1,4 @@
|
||||
Sub SetProjectorTarget(actor, x, y, z)
|
||||
Sub GetProjectorTarget(actor, ByRef x, ByRef y, ByRef z)
|
||||
Sub SetProjectorFOV(actor, fov)
|
||||
Function GetProjectorFOV(actor)
|
||||
@@ -9,3 +9,7 @@ function GetWorld3DTimeStep()
|
||||
Sub SetSceneFog(color, fog_type, start_val, end_val, density, pixelFog, rangeFog)
|
||||
Sub GetSceneFog(ByRef color, ByRef fog_type, ByRef start_val, ByRef end_val, ByRef density, ByRef pixelFog, ByRef rangeFog)
|
||||
Sub ClearScene()
|
||||
Sub SetSceneShadowColor(color)
|
||||
Function GetSceneShadowColor()
|
||||
Sub SetSceneAmbientColor(color)
|
||||
Function GetSceneAmbientColor()
|
||||
|
||||
@@ -19,3 +19,4 @@ function MessageBox(title$, msg$)
|
||||
function Runtime$()
|
||||
function NumCPUs()
|
||||
function SystemRam()
|
||||
function GetGPUInfo$()
|
||||
|
||||
@@ -923,7 +923,7 @@ int main(int argc, char * argv[])
|
||||
//rc_filename = "/home/n00b/test/stp/serenity_main.bas";
|
||||
//rc_filename = "/home/n00b/test/SpriteShapeTest/main.bas";
|
||||
//rc_filename = "/home/n00b/Programs/RCBasic_v400_Linux64/examples/Constraint/main.bas";
|
||||
//rc_filename = "/home/n00b/Programs/RCBasic_v400_Linux64/examples/Simple 3D Platformer/main.bas";
|
||||
//rc_filename = "/home/n00b/Programs/RCBasic_v401_Linux64/examples/Simple_3D_Platformer/main.bas";
|
||||
//DEBUG END
|
||||
|
||||
//enable_presets = true;
|
||||
@@ -957,7 +957,7 @@ int main(int argc, char * argv[])
|
||||
|
||||
if(rc_filename.compare("--version")==0)
|
||||
{
|
||||
cout << "RCBASIC Compiler v4.2a" << endl;
|
||||
cout << "RCBASIC Compiler v4.2" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -749,6 +749,9 @@ void init_embedded_functions()
|
||||
embed_function("SetAntiAliasMode", ID_TYPE_SUB);
|
||||
add_embedded_arg("aa_mode", ID_TYPE_NUM);
|
||||
embed_function("GetAntiAliasMode", ID_TYPE_FN_NUM);
|
||||
embed_function("ConvertToNormalMap", ID_TYPE_SUB);
|
||||
add_embedded_arg("img_id", ID_TYPE_NUM);
|
||||
add_embedded_arg("amp", ID_TYPE_NUM);
|
||||
embed_function("InKey", ID_TYPE_FN_NUM);
|
||||
embed_function("Key", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("key_code", ID_TYPE_NUM);
|
||||
@@ -1085,6 +1088,7 @@ void init_embedded_functions()
|
||||
embed_function("Runtime$", ID_TYPE_FN_STR);
|
||||
embed_function("NumCPUs", ID_TYPE_FN_NUM);
|
||||
embed_function("SystemRam", ID_TYPE_FN_NUM);
|
||||
embed_function("GetGPUInfo$", ID_TYPE_FN_STR);
|
||||
embed_function("DimMatrix", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("m_rows", ID_TYPE_NUM);
|
||||
add_embedded_arg("m_cols", ID_TYPE_NUM);
|
||||
@@ -2102,6 +2106,7 @@ void init_embedded_functions()
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
embed_function("ActorExists", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
embed_function("CreateProjectorActor", ID_TYPE_FN_NUM);
|
||||
embed_function("CreateActorAnimation", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
add_embedded_arg("start_frame", ID_TYPE_NUM);
|
||||
@@ -2866,6 +2871,12 @@ void init_embedded_functions()
|
||||
add_embedded_arg("pixelFog", ID_TYPE_BYREF_NUM);
|
||||
add_embedded_arg("rangeFog", ID_TYPE_BYREF_NUM);
|
||||
embed_function("ClearScene", ID_TYPE_SUB);
|
||||
embed_function("SetSceneShadowColor", ID_TYPE_SUB);
|
||||
add_embedded_arg("color", ID_TYPE_NUM);
|
||||
embed_function("GetSceneShadowColor", ID_TYPE_FN_NUM);
|
||||
embed_function("SetSceneAmbientColor", ID_TYPE_SUB);
|
||||
add_embedded_arg("color", ID_TYPE_NUM);
|
||||
embed_function("GetSceneAmbientColor", ID_TYPE_FN_NUM);
|
||||
embed_function("startParticleEmitter", ID_TYPE_SUB);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
embed_function("stopParticleEmitter", ID_TYPE_SUB);
|
||||
@@ -3104,6 +3115,21 @@ void init_embedded_functions()
|
||||
add_embedded_arg("patchX", ID_TYPE_NUM);
|
||||
add_embedded_arg("patchZ", ID_TYPE_NUM);
|
||||
add_embedded_arg("LOD", ID_TYPE_NUM);
|
||||
embed_function("SetProjectorTarget", ID_TYPE_SUB);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
add_embedded_arg("x", ID_TYPE_NUM);
|
||||
add_embedded_arg("y", ID_TYPE_NUM);
|
||||
add_embedded_arg("z", ID_TYPE_NUM);
|
||||
embed_function("GetProjectorTarget", ID_TYPE_SUB);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
add_embedded_arg("x", ID_TYPE_BYREF_NUM);
|
||||
add_embedded_arg("y", ID_TYPE_BYREF_NUM);
|
||||
add_embedded_arg("z", ID_TYPE_BYREF_NUM);
|
||||
embed_function("SetProjectorFOV", ID_TYPE_SUB);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
add_embedded_arg("fov", ID_TYPE_NUM);
|
||||
embed_function("GetProjectorFOV", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
embed_function("createMaterial", ID_TYPE_FN_NUM);
|
||||
embed_function("deleteMaterial", ID_TYPE_SUB);
|
||||
add_embedded_arg("material_id", ID_TYPE_NUM);
|
||||
@@ -3260,6 +3286,25 @@ void init_embedded_functions()
|
||||
add_embedded_arg("material", ID_TYPE_NUM);
|
||||
embed_function("MaterialExists", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("material", ID_TYPE_NUM);
|
||||
embed_function("NumMaterialConstants", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("material_type", ID_TYPE_NUM);
|
||||
embed_function("GetMaterialConstantName$", ID_TYPE_FN_STR);
|
||||
add_embedded_arg("material_type", ID_TYPE_NUM);
|
||||
add_embedded_arg("index", ID_TYPE_NUM);
|
||||
embed_function("SetMaterialConstant", ID_TYPE_SUB);
|
||||
add_embedded_arg("material", ID_TYPE_NUM);
|
||||
add_embedded_arg("m_constant$", ID_TYPE_STR);
|
||||
add_embedded_arg("n1", ID_TYPE_NUM);
|
||||
add_embedded_arg("n2", ID_TYPE_NUM);
|
||||
add_embedded_arg("n3", ID_TYPE_NUM);
|
||||
add_embedded_arg("n4", ID_TYPE_NUM);
|
||||
embed_function("GetMaterialConstant", ID_TYPE_SUB);
|
||||
add_embedded_arg("material", ID_TYPE_NUM);
|
||||
add_embedded_arg("m_constant$", ID_TYPE_STR);
|
||||
add_embedded_arg("n1", ID_TYPE_BYREF_NUM);
|
||||
add_embedded_arg("n2", ID_TYPE_BYREF_NUM);
|
||||
add_embedded_arg("n3", ID_TYPE_BYREF_NUM);
|
||||
add_embedded_arg("n4", ID_TYPE_BYREF_NUM);
|
||||
}
|
||||
|
||||
void init_embedded_types()
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
# depslib dependency file v1.0
|
||||
1742442082 source:/home/n00b/Projects/RCBASIC4/rcbasic_build/main.cpp
|
||||
1744257370 source:/home/n00b/Projects/RCBASIC4/rcbasic_build/main.cpp
|
||||
<iostream>
|
||||
<stack>
|
||||
<vector>
|
||||
@@ -14,7 +14,7 @@
|
||||
"env_resolve.h"
|
||||
"identifier.h"
|
||||
|
||||
1742438422 /home/n00b/Projects/RCBASIC4/rcbasic_build/tokenizer.h
|
||||
1744318795 /home/n00b/Projects/RCBASIC4/rcbasic_build/tokenizer.h
|
||||
<iostream>
|
||||
<string>
|
||||
<cctype>
|
||||
@@ -54,7 +54,7 @@
|
||||
1734372057 /home/n00b/Projects/RCBASIC4/rcbasic_build/rc_global.h
|
||||
<inttypes.h>
|
||||
|
||||
1742442075 /home/n00b/Projects/RCBASIC4/rcbasic_build/rc_builtin.h
|
||||
1744257290 /home/n00b/Projects/RCBASIC4/rcbasic_build/rc_builtin.h
|
||||
"identifier.h"
|
||||
|
||||
1734372057 /home/n00b/Projects/RCBASIC4/rcbasic_build/rc_vm_asm.h
|
||||
|
||||
@@ -2,43 +2,24 @@
|
||||
<CodeBlocks_layout_file>
|
||||
<FileVersion major="1" minor="0" />
|
||||
<ActiveTarget name="Debug" />
|
||||
<File name="main.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="28572" topLine="811" />
|
||||
</Cursor>
|
||||
<Folding>
|
||||
<Collapse line="305" />
|
||||
<Collapse line="362" />
|
||||
</Folding>
|
||||
</File>
|
||||
<File name="env_resolve.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="615" topLine="32" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="constants.h" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="0" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="tokenizer.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="50994" topLine="1243" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_utility.h" open="0" top="0" tabpos="27" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="1747" topLine="35" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="identifier.h" open="0" top="0" tabpos="26" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<File name="main.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="9544" topLine="341" />
|
||||
<Cursor1 position="28904" topLine="909" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_global.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<File name="rc_builtin.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="13014" topLine="163" />
|
||||
<Cursor1 position="112317" topLine="2509" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="constants.h" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="0" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_vm_asm.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
@@ -54,14 +35,29 @@
|
||||
<Collapse line="6341" />
|
||||
</Folding>
|
||||
</File>
|
||||
<File name="rc_builtin.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="112317" topLine="2509" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="keywords.h" open="0" top="0" tabpos="25" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="105" topLine="17" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="identifier.h" open="0" top="0" tabpos="26" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="9544" topLine="341" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="tokenizer.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="46887" topLine="1127" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="env_resolve.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="615" topLine="32" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_global.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="13014" topLine="163" />
|
||||
</Cursor>
|
||||
</File>
|
||||
</CodeBlocks_layout_file>
|
||||
|
||||
@@ -743,6 +743,9 @@ add_embedded_arg("v", ID_TYPE_NUM);
|
||||
embed_function("SetAntiAliasMode", ID_TYPE_SUB);
|
||||
add_embedded_arg("aa_mode", ID_TYPE_NUM);
|
||||
embed_function("GetAntiAliasMode", ID_TYPE_FN_NUM);
|
||||
embed_function("ConvertToNormalMap", ID_TYPE_SUB);
|
||||
add_embedded_arg("img_id", ID_TYPE_NUM);
|
||||
add_embedded_arg("amp", ID_TYPE_NUM);
|
||||
embed_function("InKey", ID_TYPE_FN_NUM);
|
||||
embed_function("Key", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("key_code", ID_TYPE_NUM);
|
||||
@@ -1079,6 +1082,7 @@ add_embedded_arg("msg$", ID_TYPE_STR);
|
||||
embed_function("Runtime$", ID_TYPE_FN_STR);
|
||||
embed_function("NumCPUs", ID_TYPE_FN_NUM);
|
||||
embed_function("SystemRam", ID_TYPE_FN_NUM);
|
||||
embed_function("GetGPUInfo$", ID_TYPE_FN_STR);
|
||||
embed_function("DimMatrix", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("m_rows", ID_TYPE_NUM);
|
||||
add_embedded_arg("m_cols", ID_TYPE_NUM);
|
||||
@@ -2096,6 +2100,7 @@ embed_function("RemoveActorShadow", ID_TYPE_SUB);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
embed_function("ActorExists", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
embed_function("CreateProjectorActor", ID_TYPE_FN_NUM);
|
||||
embed_function("CreateActorAnimation", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
add_embedded_arg("start_frame", ID_TYPE_NUM);
|
||||
@@ -2860,6 +2865,12 @@ add_embedded_arg("density", ID_TYPE_BYREF_NUM);
|
||||
add_embedded_arg("pixelFog", ID_TYPE_BYREF_NUM);
|
||||
add_embedded_arg("rangeFog", ID_TYPE_BYREF_NUM);
|
||||
embed_function("ClearScene", ID_TYPE_SUB);
|
||||
embed_function("SetSceneShadowColor", ID_TYPE_SUB);
|
||||
add_embedded_arg("color", ID_TYPE_NUM);
|
||||
embed_function("GetSceneShadowColor", ID_TYPE_FN_NUM);
|
||||
embed_function("SetSceneAmbientColor", ID_TYPE_SUB);
|
||||
add_embedded_arg("color", ID_TYPE_NUM);
|
||||
embed_function("GetSceneAmbientColor", ID_TYPE_FN_NUM);
|
||||
embed_function("startParticleEmitter", ID_TYPE_SUB);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
embed_function("stopParticleEmitter", ID_TYPE_SUB);
|
||||
@@ -3098,6 +3109,21 @@ add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
add_embedded_arg("patchX", ID_TYPE_NUM);
|
||||
add_embedded_arg("patchZ", ID_TYPE_NUM);
|
||||
add_embedded_arg("LOD", ID_TYPE_NUM);
|
||||
embed_function("SetProjectorTarget", ID_TYPE_SUB);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
add_embedded_arg("x", ID_TYPE_NUM);
|
||||
add_embedded_arg("y", ID_TYPE_NUM);
|
||||
add_embedded_arg("z", ID_TYPE_NUM);
|
||||
embed_function("GetProjectorTarget", ID_TYPE_SUB);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
add_embedded_arg("x", ID_TYPE_BYREF_NUM);
|
||||
add_embedded_arg("y", ID_TYPE_BYREF_NUM);
|
||||
add_embedded_arg("z", ID_TYPE_BYREF_NUM);
|
||||
embed_function("SetProjectorFOV", ID_TYPE_SUB);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
add_embedded_arg("fov", ID_TYPE_NUM);
|
||||
embed_function("GetProjectorFOV", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
embed_function("createMaterial", ID_TYPE_FN_NUM);
|
||||
embed_function("deleteMaterial", ID_TYPE_SUB);
|
||||
add_embedded_arg("material_id", ID_TYPE_NUM);
|
||||
@@ -3254,3 +3280,22 @@ add_embedded_arg("actor", ID_TYPE_NUM);
|
||||
add_embedded_arg("material", ID_TYPE_NUM);
|
||||
embed_function("MaterialExists", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("material", ID_TYPE_NUM);
|
||||
embed_function("NumMaterialConstants", ID_TYPE_FN_NUM);
|
||||
add_embedded_arg("material_type", ID_TYPE_NUM);
|
||||
embed_function("GetMaterialConstantName$", ID_TYPE_FN_STR);
|
||||
add_embedded_arg("material_type", ID_TYPE_NUM);
|
||||
add_embedded_arg("index", ID_TYPE_NUM);
|
||||
embed_function("SetMaterialConstant", ID_TYPE_SUB);
|
||||
add_embedded_arg("material", ID_TYPE_NUM);
|
||||
add_embedded_arg("m_constant$", ID_TYPE_STR);
|
||||
add_embedded_arg("n1", ID_TYPE_NUM);
|
||||
add_embedded_arg("n2", ID_TYPE_NUM);
|
||||
add_embedded_arg("n3", ID_TYPE_NUM);
|
||||
add_embedded_arg("n4", ID_TYPE_NUM);
|
||||
embed_function("GetMaterialConstant", ID_TYPE_SUB);
|
||||
add_embedded_arg("material", ID_TYPE_NUM);
|
||||
add_embedded_arg("m_constant$", ID_TYPE_STR);
|
||||
add_embedded_arg("n1", ID_TYPE_BYREF_NUM);
|
||||
add_embedded_arg("n2", ID_TYPE_BYREF_NUM);
|
||||
add_embedded_arg("n3", ID_TYPE_BYREF_NUM);
|
||||
add_embedded_arg("n4", ID_TYPE_BYREF_NUM);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -769,6 +769,9 @@ case FN_SetAntiAliasMode: //Sub Procedure
|
||||
case FN_GetAntiAliasMode: //Number Function
|
||||
rc_push_num(rc_getAntiAliasMode( ));
|
||||
break;
|
||||
case FN_ConvertToNormalMap: //Sub Procedure
|
||||
rc_convertToNormalMap( CONVERTTONORMALMAP_IMG_ID, CONVERTTONORMALMAP_AMP );
|
||||
break;
|
||||
case FN_InKey: //Number Function
|
||||
rc_push_num(rc_inKey( ));
|
||||
break;
|
||||
@@ -1208,6 +1211,9 @@ case FN_NumCPUs: //Number Function
|
||||
case FN_SystemRam: //Number Function
|
||||
rc_push_num(rc_intern_systemRam( ));
|
||||
break;
|
||||
case FN_GetGPUInfo$: //String Function
|
||||
rc_push_str(rc_getGPUInfo( ));
|
||||
break;
|
||||
case FN_DimMatrix: //Number Function
|
||||
rc_push_num(rc_dimMatrix( DIMMATRIX_M_ROWS, DIMMATRIX_M_COLS ));
|
||||
break;
|
||||
@@ -2102,6 +2108,9 @@ case FN_RemoveActorShadow: //Sub Procedure
|
||||
case FN_ActorExists: //Number Function
|
||||
rc_push_num(rc_actorExists( ACTOREXISTS_ACTOR ));
|
||||
break;
|
||||
case FN_CreateProjectorActor: //Number Function
|
||||
rc_push_num(rc_createProjectorActor( ));
|
||||
break;
|
||||
case FN_CreateActorAnimation: //Number Function
|
||||
rc_push_num(rc_createActorAnimation( CREATEACTORANIMATION_ACTOR, CREATEACTORANIMATION_START_FRAME, CREATEACTORANIMATION_END_FRAME, CREATEACTORANIMATION_SPEED ));
|
||||
break;
|
||||
@@ -2741,6 +2750,18 @@ case FN_GetSceneFog: //Sub Procedure
|
||||
case FN_ClearScene: //Sub Procedure
|
||||
rc_clearScene( );
|
||||
break;
|
||||
case FN_SetSceneShadowColor: //Sub Procedure
|
||||
rc_setSceneShadowColor( SETSCENESHADOWCOLOR_COLOR );
|
||||
break;
|
||||
case FN_GetSceneShadowColor: //Number Function
|
||||
rc_push_num(rc_getSceneShadowColor( ));
|
||||
break;
|
||||
case FN_SetSceneAmbientColor: //Sub Procedure
|
||||
rc_setSceneAmbientColor( SETSCENEAMBIENTCOLOR_COLOR );
|
||||
break;
|
||||
case FN_GetSceneAmbientColor: //Number Function
|
||||
rc_push_num(rc_getSceneAmbientColor( ));
|
||||
break;
|
||||
case FN_startParticleEmitter: //Sub Procedure
|
||||
rc_startParticleEmitter( STARTPARTICLEEMITTER_ACTOR );
|
||||
break;
|
||||
@@ -2960,6 +2981,18 @@ case FN_SetTerrainCameraRotationDelta: //Sub Procedure
|
||||
case FN_SetTerrainPatchLOD: //Sub Procedure
|
||||
rc_setTerrainPatchLOD( SETTERRAINPATCHLOD_ACTOR, SETTERRAINPATCHLOD_PATCHX, SETTERRAINPATCHLOD_PATCHZ, SETTERRAINPATCHLOD_LOD );
|
||||
break;
|
||||
case FN_SetProjectorTarget: //Sub Procedure
|
||||
rc_setProjectorTarget( SETPROJECTORTARGET_ACTOR, SETPROJECTORTARGET_X, SETPROJECTORTARGET_Y, SETPROJECTORTARGET_Z );
|
||||
break;
|
||||
case FN_GetProjectorTarget: //Sub Procedure
|
||||
rc_getProjectorTarget( GETPROJECTORTARGET_ACTOR, &GETPROJECTORTARGET_X, &GETPROJECTORTARGET_Y, &GETPROJECTORTARGET_Z );
|
||||
break;
|
||||
case FN_SetProjectorFOV: //Sub Procedure
|
||||
rc_setProjectorFOV( SETPROJECTORFOV_ACTOR, SETPROJECTORFOV_FOV );
|
||||
break;
|
||||
case FN_GetProjectorFOV: //Number Function
|
||||
rc_push_num(rc_getProjectorFOV( GETPROJECTORFOV_ACTOR ));
|
||||
break;
|
||||
case FN_createMaterial: //Number Function
|
||||
rc_push_num(rc_createMaterial( ));
|
||||
break;
|
||||
@@ -3137,3 +3170,15 @@ case FN_getActorMaterialType: //Number Function
|
||||
case FN_MaterialExists: //Number Function
|
||||
rc_push_num(rc_materialExists( MATERIALEXISTS_MATERIAL ));
|
||||
break;
|
||||
case FN_NumMaterialConstants: //Number Function
|
||||
rc_push_num(rc_numMaterialConstants( NUMMATERIALCONSTANTS_MATERIAL_TYPE ));
|
||||
break;
|
||||
case FN_GetMaterialConstantName$: //String Function
|
||||
rc_push_str(rc_getMaterialConstantName( GETMATERIALCONSTANTNAME$_MATERIAL_TYPE, GETMATERIALCONSTANTNAME$_INDEX ));
|
||||
break;
|
||||
case FN_SetMaterialConstant: //Sub Procedure
|
||||
rc_setMaterialConstant( SETMATERIALCONSTANT_MATERIAL, SETMATERIALCONSTANT_M_CONSTANT$, SETMATERIALCONSTANT_N1, SETMATERIALCONSTANT_N2, SETMATERIALCONSTANT_N3, SETMATERIALCONSTANT_N4 );
|
||||
break;
|
||||
case FN_GetMaterialConstant: //Sub Procedure
|
||||
rc_getMaterialConstant( GETMATERIALCONSTANT_MATERIAL, GETMATERIALCONSTANT_M_CONSTANT$, &GETMATERIALCONSTANT_N1, &GETMATERIALCONSTANT_N2, &GETMATERIALCONSTANT_N3, &GETMATERIALCONSTANT_N4 );
|
||||
break;
|
||||
|
||||
@@ -1112,8 +1112,30 @@ string rc_keywordToken(string sline)
|
||||
return "<num>22";
|
||||
else if(sline.compare("MATERIAL_TYPE_ONETEXTURE_BLEND")==0)
|
||||
return "<num>23";
|
||||
else if(sline.compare("MATERIAL_TYPE_FORCE_32BIT")==0)
|
||||
return "<num>24";
|
||||
else if(sline.compare("FX_MATERIAL_TYPE_NORMAL_BLEND")==0)
|
||||
return "<num>128";
|
||||
else if(sline.compare("FX_MATERIAL_TYPE_REFRACTION")==0)
|
||||
return "<num>129";
|
||||
else if(sline.compare("FX_MATERIAL_TYPE_REFRACTION2")==0)
|
||||
return "<num>130";
|
||||
else if(sline.compare("FX_MATERIAL_TYPE_GOOCH")==0)
|
||||
return "<num>131";
|
||||
else if(sline.compare("FX_MATERIAL_TYPE_PLASTIC")==0)
|
||||
return "<num>132";
|
||||
else if(sline.compare("FX_MATERIAL_TYPE_TANGENT")==0)
|
||||
return "<num>133";
|
||||
else if(sline.compare("FX_MATERIAL_TYPE_SPEAKER")==0)
|
||||
return "<num>134";
|
||||
else if(sline.compare("FX_MATERIAL_TYPE_PHONG_TEXTURE")==0)
|
||||
return "<num>135";
|
||||
else if(sline.compare("FX_MATERIAL_TYPE_STYLE")==0)
|
||||
return "<num>136";
|
||||
else if(sline.compare("FX_MATERIAL_TYPE_STYLE2")==0)
|
||||
return "<num>137";
|
||||
else if(sline.compare("FX_MATERIAL_TYPE_STYLE3")==0)
|
||||
return "<num>138";
|
||||
else if(sline.compare("FX_MATERIAL_TYPE_STYLE4")==0)
|
||||
return "<num>139";
|
||||
else if(sline.compare("BLEND_MODE_NONE")==0)
|
||||
return "<num>0";
|
||||
else if(sline.compare("BLEND_MODE_ADD")==0)
|
||||
|
||||
400
rcbasic_runtime/CShader.cpp
Executable file
400
rcbasic_runtime/CShader.cpp
Executable file
@@ -0,0 +1,400 @@
|
||||
/**************************************************************
|
||||
file: CShader.h
|
||||
author: Stephan Gödecker (Masterhawk studios)
|
||||
version: rev. 5
|
||||
|
||||
description: this file was created to achieve a dynamic
|
||||
management for GLSL shaders with irrlicht. After implementing
|
||||
this code-snippet the user is able to dynamically load GLSL-
|
||||
shader in his irrlicht application. The shader just have to
|
||||
be additionally defined by a special xml-file. You can get
|
||||
further information at:
|
||||
|
||||
http://www.masterhawk.dyndns.org/wordpress?p=267
|
||||
|
||||
***************************************************************/
|
||||
|
||||
#include <irrlicht.h>
|
||||
#include <iostream>
|
||||
#include "CShader.h"
|
||||
|
||||
rc_shader_value_obj rc_shader_float(float n)
|
||||
{
|
||||
rc_shader_value_obj v;
|
||||
v.type = RC_SHADER_VALUE_TYPE_FLOAT;
|
||||
v.fvalue = n;
|
||||
return v;
|
||||
}
|
||||
|
||||
rc_shader_value_obj rc_shader_string(std::string s)
|
||||
{
|
||||
rc_shader_value_obj v;
|
||||
v.type = RC_SHADER_VALUE_TYPE_STRING;
|
||||
v.svalue = s;
|
||||
return v;
|
||||
}
|
||||
|
||||
CShader::CShader(IrrlichtDevice* device, rc_shader_material_obj shader_material)
|
||||
{
|
||||
|
||||
dev=device;
|
||||
|
||||
f_old_cycle_time = dev->getTimer()->getRealTime();
|
||||
|
||||
driver = device->getVideoDriver();
|
||||
|
||||
//Missing xml-handling
|
||||
|
||||
irr::video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices();
|
||||
p_material = 0;
|
||||
|
||||
obj_node = 0;
|
||||
|
||||
if(gpu)
|
||||
{
|
||||
//std::cout << "Compiling Shader" << std::endl;
|
||||
//std::cout << shader_material.vert_shader << std::endl << std::endl;
|
||||
//std::cout << shader_material.frag_shader << std::endl << std::endl;
|
||||
p_material = gpu->addHighLevelShaderMaterial(
|
||||
shader_material.vert_shader.c_str(), "vertexMain", video::EVST_VS_4_1,
|
||||
shader_material.frag_shader.c_str(), "pixelMain", video::EPST_PS_4_1,
|
||||
this, video::EMT_SOLID);
|
||||
|
||||
//std::cout << "Result: " << p_material << std::endl;
|
||||
}
|
||||
|
||||
|
||||
for(s32 i=0; i<shader_material.shader_object.size(); i++)
|
||||
{
|
||||
//create new uniform variable
|
||||
SShaderVariable* shader_var = new SShaderVariable();
|
||||
shader_var->predefinition = ESPV_NONE;
|
||||
|
||||
irr::core::stringc type( shader_material.shader_object[i].type.c_str() );
|
||||
|
||||
if(type.equals_ignore_case("float"))
|
||||
shader_var->type = ESVT_FLOAT;
|
||||
else if(type.equals_ignore_case("vec2"))
|
||||
shader_var->type = ESVT_VEC2;
|
||||
else if(type.equals_ignore_case("vec3"))
|
||||
shader_var->type = ESVT_VEC3;
|
||||
else if(type.equals_ignore_case("vec4"))
|
||||
shader_var->type = ESVT_VEC4;
|
||||
else if(type.equals_ignore_case("mat4"))
|
||||
shader_var->type = ESVT_MAT4;
|
||||
else if(type.equals_ignore_case("sampler2d"))
|
||||
shader_var->type = ESVT_SAMPLER2D;
|
||||
else if(type.equals_ignore_case("predefined"))
|
||||
shader_var->type = ESVT_PREDEFINED;
|
||||
|
||||
shader_var->name = core::stringc( shader_material.shader_object[i].name.c_str() );
|
||||
|
||||
|
||||
shader_var->b_frag_var = shader_material.shader_object[i].fragVar;
|
||||
|
||||
switch(shader_var->type)
|
||||
{
|
||||
case ESVT_SAMPLER2D:
|
||||
case ESVT_FLOAT:
|
||||
{
|
||||
float* vars = new float[1];
|
||||
vars[0] = shader_material.shader_object[i].value[0].fvalue;
|
||||
shader_var->value = vars;
|
||||
|
||||
}break;
|
||||
|
||||
/*case ESVT_SAMPLER2D:
|
||||
{
|
||||
int tex = 0;
|
||||
|
||||
TiXmlNode* value = node->FirstChild("value");
|
||||
|
||||
tex = ((TiXmlElement*)value)->FirstAttribute()->IntValue();
|
||||
|
||||
float* vars = new float[1];
|
||||
vars = (float*)(&tex);
|
||||
shader_var->value = vars;
|
||||
}break;*/
|
||||
|
||||
case ESVT_VEC2:
|
||||
{
|
||||
float* vars = new float[2];
|
||||
|
||||
for(s32 j=0; j<2; j++)
|
||||
{
|
||||
vars[j] = shader_material.shader_object[i].value[j].fvalue;
|
||||
}
|
||||
shader_var->value = vars;
|
||||
}break;
|
||||
|
||||
case ESVT_VEC3:
|
||||
{
|
||||
float* vars = new float[3];
|
||||
|
||||
for(s32 j=0; j<3; j++)
|
||||
{
|
||||
vars[j] = shader_material.shader_object[i].value[j].fvalue;
|
||||
}
|
||||
shader_var->value = vars;
|
||||
}break;
|
||||
|
||||
case ESVT_VEC4:
|
||||
{
|
||||
float* vars = new float[4];
|
||||
|
||||
for(s32 j=0; j<4; j++)
|
||||
{
|
||||
vars[j] = shader_material.shader_object[i].value[j].fvalue;
|
||||
}
|
||||
shader_var->value = vars;
|
||||
}break;
|
||||
|
||||
case ESVT_MAT4:
|
||||
break;
|
||||
|
||||
case ESVT_PREDEFINED:
|
||||
{
|
||||
core::stringc str_val(shader_material.shader_object[i].value[0].svalue.c_str());
|
||||
|
||||
shader_var->value = 0;
|
||||
|
||||
if(str_val.equals_ignore_case("predefined_eye_position"))
|
||||
shader_var->predefinition = ESPV_EYEPOSITION;
|
||||
else if(str_val.equals_ignore_case("predefined_mat4_view_proj"))
|
||||
{
|
||||
shader_var->predefinition = ESPV_MAT4_VIEW_PROJ;
|
||||
}
|
||||
else if(str_val.equals_ignore_case("predefined_mat4_view"))
|
||||
{
|
||||
shader_var->predefinition = ESPV_MAT4_VIEW;
|
||||
}
|
||||
else if(str_val.equals_ignore_case("predefined_float_time0x"))
|
||||
{
|
||||
shader_var->predefinition = ESPV_FLOAT_TIME0X;
|
||||
shader_var->value = new float[1];
|
||||
shader_var->value[0] = 0.f;
|
||||
}
|
||||
else if(str_val.equals_ignore_case("predefined_rtt_view"))
|
||||
{
|
||||
shader_var->predefinition = ESPV_NONE;
|
||||
shader_var->type = ESVT_SAMPLER2D;
|
||||
|
||||
float* vars = new float[1];
|
||||
|
||||
vars[0] = (shader_material.shader_object[i].additional_value.size() > 0 ? shader_material.shader_object[i].additional_value[0].fvalue : 0);
|
||||
|
||||
shader_var->value = vars;
|
||||
|
||||
//registering for RTT_VIEW
|
||||
S_RTT_Info* rtt_info = new S_RTT_Info();
|
||||
rtt_info->type = ERT_VIEW;
|
||||
rtt_info->tex_channel = (int)vars[0];
|
||||
rtt_infos.push_back(rtt_info);
|
||||
|
||||
rtt_info = 0;
|
||||
|
||||
}
|
||||
else if(str_val.equals_ignore_case("predefined_toonLightPos_position"))
|
||||
{
|
||||
shader_var->predefinition = ESPV_RC_TOON_LIGHTPOS;
|
||||
}
|
||||
else
|
||||
printf("ERROR: Unknown predefinition: %s\n",str_val.c_str());
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
/// printf("(XML PARSER) ERROR: No type for uniform shader variable specified: %s\n",shader_var->name);
|
||||
break;
|
||||
}//end switch
|
||||
|
||||
uniform_variables.push_back(shader_var);
|
||||
}
|
||||
//printf("(MATERIAL PARSER) Initialized %i uniform variables\n",uniform_variables.size());
|
||||
for(s32 i=0; i<uniform_variables.size(); i++)
|
||||
{
|
||||
//printf("(MATERIAL PARSER) VAR%i: %s VALUE: ",i,uniform_variables[i]->name.c_str());
|
||||
if(uniform_variables[i]->type == ESVT_PREDEFINED)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
s32 element_count = (uniform_variables[i]->type != ESVT_SAMPLER2D) ? (s32)uniform_variables[i]->type : 1;
|
||||
//for(s32 j=0; j<element_count; j++)
|
||||
//if(uniform_variables[i]->type != ESVT_SAMPLER2D)
|
||||
//printf("%f ",(uniform_variables[i]->value[j]));
|
||||
//else
|
||||
//printf("%i",*uniform_variables[i]->value);
|
||||
//printf("\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
void CShader::OnSetConstants(video::IMaterialRendererServices* services, s32 userData)
|
||||
{
|
||||
for(s32 i=0; i<uniform_variables.size(); i++)
|
||||
{
|
||||
int element_count = 0;
|
||||
switch(uniform_variables[i]->type)
|
||||
{
|
||||
case ESVT_SAMPLER2D:
|
||||
element_count = 1;
|
||||
break;
|
||||
case ESVT_PREDEFINED:
|
||||
{
|
||||
switch(uniform_variables[i]->predefinition)
|
||||
{
|
||||
case ESPV_EYEPOSITION:
|
||||
{
|
||||
if(uniform_variables[i]->value)
|
||||
{
|
||||
delete[] uniform_variables[i]->value;
|
||||
uniform_variables[i]->value = 0;
|
||||
}
|
||||
|
||||
uniform_variables[i]->value = new float[3];
|
||||
core::vector3df cam_pos = dev->getSceneManager()->getActiveCamera()->getAbsolutePosition();
|
||||
uniform_variables[i]->value[0] = cam_pos.X;
|
||||
uniform_variables[i]->value[1] = cam_pos.Y;
|
||||
uniform_variables[i]->value[2] = cam_pos.Z;
|
||||
|
||||
element_count = 3;
|
||||
}
|
||||
break;
|
||||
|
||||
case ESPV_MAT4_VIEW:
|
||||
{
|
||||
core::matrix4 mat_view = dev->getVideoDriver()->getTransform(video::ETS_VIEW);
|
||||
|
||||
uniform_variables[i]->value = mat_view.pointer();
|
||||
|
||||
element_count = 16;
|
||||
}
|
||||
break;
|
||||
|
||||
case ESPV_MAT4_VIEW_PROJ:
|
||||
{
|
||||
core::matrix4 mat_view_proj = dev->getVideoDriver()->getTransform(video::ETS_PROJECTION);
|
||||
|
||||
mat_view_proj *= dev->getVideoDriver()->getTransform(video::ETS_VIEW);
|
||||
|
||||
uniform_variables[i]->value = mat_view_proj.pointer();
|
||||
|
||||
element_count = 16;
|
||||
|
||||
/*printf("VIEW_PROJECTION_MATRIX\n");
|
||||
for(int k=0; k<16; k++)
|
||||
{
|
||||
printf("%f ",uniform_variables[i]->value[k]);
|
||||
if(k==3 || k==7 || k==11 || k==15) printf("\n");
|
||||
}*/
|
||||
}
|
||||
break;
|
||||
|
||||
case ESPV_FLOAT_TIME0X:
|
||||
{
|
||||
|
||||
f32 f_time_diff = dev->getTimer()->getRealTime() - f_old_cycle_time;
|
||||
|
||||
uniform_variables[i]->value[0] += f_time_diff / 1000;
|
||||
|
||||
s32 i_tmp = uniform_variables[i]->value[0] / 120;
|
||||
|
||||
uniform_variables[i]->value[0] = uniform_variables[i]->value[0] - (i_tmp*120);
|
||||
|
||||
f_old_cycle_time = dev->getTimer()->getRealTime();
|
||||
|
||||
element_count = 1;
|
||||
|
||||
//printf("FLOAT_TIME0X = %f\n",uniform_variables[i]->value[0]);
|
||||
}
|
||||
break;
|
||||
|
||||
case ESPV_RC_TOON_LIGHTPOS:
|
||||
{
|
||||
if(this->obj_node != NULL)
|
||||
{
|
||||
core::vector3df pos_in_world_space = dev->getSceneManager()->getActiveCamera()->getAbsolutePosition();
|
||||
core::vector3df pos_in_node_space(pos_in_world_space);
|
||||
|
||||
core::matrix4 world_to_local = this->obj_node->getAbsoluteTransformation();
|
||||
world_to_local.makeInverse();
|
||||
|
||||
world_to_local.transformVect(pos_in_world_space);
|
||||
f32 lightPos[3] = { pos_in_world_space.X, pos_in_world_space.Y, pos_in_world_space.Z };
|
||||
services->setVertexShaderConstant("lightPos", lightPos, 3);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
default:
|
||||
element_count = (s32)uniform_variables[i]->type;
|
||||
}
|
||||
if(uniform_variables[i]->b_frag_var)
|
||||
if(uniform_variables[i]->type != ESVT_SAMPLER2D)
|
||||
services->setPixelShaderConstant(uniform_variables[i]->name.c_str(),uniform_variables[i]->value,element_count);
|
||||
else
|
||||
{
|
||||
int tex = *uniform_variables[i]->value;
|
||||
services->setPixelShaderConstant(uniform_variables[i]->name.c_str(),(float*)(&tex),element_count);
|
||||
}
|
||||
|
||||
else
|
||||
if(uniform_variables[i]->type != ESVT_SAMPLER2D)
|
||||
services->setVertexShaderConstant(uniform_variables[i]->name.c_str(),uniform_variables[i]->value,element_count);
|
||||
else
|
||||
{
|
||||
int tex = *uniform_variables[i]->value;
|
||||
services->setVertexShaderConstant(uniform_variables[i]->name.c_str(),(int*)(&tex),element_count);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CShader::setObjectNode(irr::scene::ISceneNode* node)
|
||||
{
|
||||
this->obj_node = node;
|
||||
}
|
||||
|
||||
s32 CShader::getMaterial()
|
||||
{
|
||||
return p_material;
|
||||
}
|
||||
|
||||
int CShader::getUniformVariableCount()
|
||||
{
|
||||
return uniform_variables.size();
|
||||
}
|
||||
|
||||
SShaderVariable* CShader::getUniformVariable(int i)
|
||||
{
|
||||
if(i < 0 || i >= uniform_variables.size())
|
||||
return NULL;
|
||||
|
||||
return uniform_variables[i];
|
||||
}
|
||||
|
||||
S_RTT_Info* CShader::getRTTInfo(E_RTT_TEXTURE rtt)
|
||||
{
|
||||
for(s32 i=0; i<rtt_infos.size(); i++)
|
||||
{
|
||||
if(rtt == rtt_infos[i]->type)
|
||||
return rtt_infos[i];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
CShader::~CShader()
|
||||
{
|
||||
for(s32 i=0; i<uniform_variables.size(); i++)
|
||||
{
|
||||
if(uniform_variables[i]->predefinition != ESPV_MAT4_VIEW_PROJ && uniform_variables[i]->predefinition != ESPV_MAT4_VIEW)
|
||||
delete[] uniform_variables[i]->value;
|
||||
|
||||
delete uniform_variables[i];
|
||||
uniform_variables[i] = 0;
|
||||
}
|
||||
uniform_variables.clear();
|
||||
}
|
||||
128
rcbasic_runtime/CShader.h
Executable file
128
rcbasic_runtime/CShader.h
Executable file
@@ -0,0 +1,128 @@
|
||||
#ifndef CSHADER_H_INCLUDED
|
||||
#define CSHADER_H_INCLUDED
|
||||
|
||||
/**************************************************************
|
||||
file: CShader.h
|
||||
author: Stephan Gödecker (Masterhawk studios)
|
||||
version: rev. 5
|
||||
|
||||
description: this file was created to achieve a dynamic
|
||||
management for GLSL shaders with irrlicht. After implementing
|
||||
this code-snippet the user is able to dynamically load GLSL-
|
||||
shader in his irrlicht application. The shader just have to
|
||||
be additionally defined by a special xml-file. You can get
|
||||
further information at:
|
||||
|
||||
http://www.masterhawk.dyndns.org/wordpress?p=267
|
||||
|
||||
***************************************************************/
|
||||
|
||||
//#include "stdafx.h"
|
||||
#include <irrlicht.h>
|
||||
#include <string>
|
||||
|
||||
using namespace irr;
|
||||
|
||||
#define RC_SHADER_VALUE_TYPE_FLOAT 0
|
||||
#define RC_SHADER_VALUE_TYPE_STRING 1
|
||||
|
||||
struct rc_shader_value_obj
|
||||
{
|
||||
int type;
|
||||
float fvalue;
|
||||
std::string svalue;
|
||||
};
|
||||
|
||||
rc_shader_value_obj rc_shader_float(float n);
|
||||
rc_shader_value_obj rc_shader_string(std::string s);
|
||||
|
||||
struct rc_shader_obj
|
||||
{
|
||||
std::string name;
|
||||
std::string type;
|
||||
bool fragVar;
|
||||
bool artistVar;
|
||||
irr::core::array<rc_shader_value_obj> value;
|
||||
irr::core::array<rc_shader_value_obj> additional_value;
|
||||
};
|
||||
|
||||
struct rc_shader_material_obj
|
||||
{
|
||||
std::string frag_shader;
|
||||
std::string vert_shader;
|
||||
irr::core::array<rc_shader_obj> shader_object;
|
||||
};
|
||||
|
||||
enum E_SHADER_VAR_TYPE
|
||||
{
|
||||
ESVT_FLOAT = 1,
|
||||
ESVT_VEC2 = 2,
|
||||
ESVT_VEC3 = 3,
|
||||
ESVT_VEC4 = 4,
|
||||
ESVT_MAT4 = 16,
|
||||
ESVT_SAMPLER2D,
|
||||
ESVT_PREDEFINED
|
||||
};
|
||||
enum E_SHADER_PREDEFINED_VARS
|
||||
{
|
||||
ESPV_NONE,
|
||||
ESPV_FLOAT_TIME0X,
|
||||
ESPV_EYEPOSITION,
|
||||
ESPV_MAT4_VIEW,
|
||||
ESPV_MAT4_VIEW_PROJ,
|
||||
ESPV_RTT_VIEW,
|
||||
ESPV_RC_TOON_LIGHTPOS
|
||||
};
|
||||
|
||||
enum E_RTT_TEXTURE
|
||||
{
|
||||
ERT_VIEW = 0x0001
|
||||
};
|
||||
|
||||
struct S_RTT_Info
|
||||
{
|
||||
E_RTT_TEXTURE type;
|
||||
s32 tex_channel;
|
||||
};
|
||||
|
||||
struct SShaderVariable
|
||||
{
|
||||
core::stringc name;
|
||||
E_SHADER_VAR_TYPE type;
|
||||
E_SHADER_PREDEFINED_VARS predefinition;
|
||||
bool b_frag_var;
|
||||
float* value;
|
||||
};
|
||||
|
||||
class CShader : public video::IShaderConstantSetCallBack
|
||||
{
|
||||
private:
|
||||
s32 p_material; //material which has to be applied to a scene_node
|
||||
IrrlichtDevice* dev;
|
||||
video::IVideoDriver* driver;
|
||||
|
||||
//temporarily
|
||||
core::array<SShaderVariable*> uniform_variables;
|
||||
|
||||
core::array<S_RTT_Info*> rtt_infos;
|
||||
|
||||
f32 f_old_cycle_time;
|
||||
|
||||
irr::scene::ISceneNode* obj_node;
|
||||
|
||||
public:
|
||||
CShader(IrrlichtDevice* device, rc_shader_material_obj shader_material);
|
||||
~CShader();
|
||||
|
||||
virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData);
|
||||
|
||||
void setObjectNode(irr::scene::ISceneNode* node);
|
||||
|
||||
s32 getMaterial();
|
||||
int getUniformVariableCount();
|
||||
SShaderVariable* getUniformVariable(int i);
|
||||
|
||||
S_RTT_Info* getRTTInfo(E_RTT_TEXTURE rtt);
|
||||
};
|
||||
|
||||
#endif // CSHADER_H_INCLUDED
|
||||
196
rcbasic_runtime/ProjectiveTextures.cpp
Executable file
196
rcbasic_runtime/ProjectiveTextures.cpp
Executable file
@@ -0,0 +1,196 @@
|
||||
#include "ProjectiveTextures.h"
|
||||
#include <string>
|
||||
|
||||
/* CONSTRUCTOR */
|
||||
CProjectiveTextures::CProjectiveTextures(irr::IrrlichtDevice* dev, irr::scene::ISceneNode* parent, irr::scene::ISceneManager* mgr, irr::s32 id,
|
||||
const irr::core::vector3df& position, const irr::core::vector3df& lookat)
|
||||
: irr::scene::ISceneNode(parent, mgr, id, position)
|
||||
{
|
||||
pDevice = dev;
|
||||
pVideo = pDevice->getVideoDriver();
|
||||
pScene = pDevice->getSceneManager();
|
||||
pGUI = pDevice->getGUIEnvironment();
|
||||
pGPU = pVideo->getGPUProgrammingServices();
|
||||
pCollision = pScene->getSceneCollisionManager();
|
||||
pLog = pDevice->getLogger();
|
||||
|
||||
// set default projection
|
||||
Fovy = irr::core::PI / 2.5f; // Field of view, in radians.
|
||||
|
||||
Target = lookat;
|
||||
|
||||
recalculateProjectionMatrix();
|
||||
recalculateViewArea();
|
||||
|
||||
std::string projector_vert =
|
||||
"!!ARBvp1.0 \n"
|
||||
"# cgc version 2.1.0016, build date Nov 20 2008 \n"
|
||||
"# command line args: -oglsl -bestprecision -O3 -profile arbvp1 \n"
|
||||
"# source file: projector.vert \n"
|
||||
"#vendor NVIDIA Corporation \n"
|
||||
"#version 2.1.0.16 \n"
|
||||
"#profile arbvp1 \n"
|
||||
"#program main \n"
|
||||
"#semantic gl_ModelViewProjectionMatrixTranspose : state.matrix.mvp \n"
|
||||
"#semantic TexGenMat \n"
|
||||
"#var float4 gl_TexCoord[0] : $vout.TEX0 : TEX0 : -1 : 1 \n"
|
||||
"#var float4 gl_TexCoord[1] : : : -1 : 0 \n"
|
||||
"#var float4 gl_TexCoord[2] : : : -1 : 0 \n"
|
||||
"#var float4 gl_TexCoord[3] : : : -1 : 0 \n"
|
||||
"#var float4 gl_TexCoord[4] : : : -1 : 0 \n"
|
||||
"#var float4 gl_TexCoord[5] : : : -1 : 0 \n"
|
||||
"#var float4 gl_TexCoord[6] : : : -1 : 0 \n"
|
||||
"#var float4 gl_TexCoord[7] : : : -1 : 0 \n"
|
||||
"#var float4 gl_Vertex : $vin.POSITION : POSITION : -1 : 1 \n"
|
||||
"#var float4 gl_Position : $vout.POSITION : HPOS : -1 : 1 \n"
|
||||
"#var float4x4 gl_ModelViewProjectionMatrixTranspose : state.matrix.mvp : c[1], 4 : -1 : 1 \n"
|
||||
"#var float4x4 TexGenMat : : c[5], 4 : -1 : 1 \n"
|
||||
"PARAM c[9] = { program.local[0], \n"
|
||||
" state.matrix.mvp, \n"
|
||||
" program.local[5..8] }; \n"
|
||||
"TEMP R0; \n"
|
||||
"MUL R0, vertex.position.y, c[6]; \n"
|
||||
"MAD R0, vertex.position.x, c[5], R0; \n"
|
||||
"MAD R0, vertex.position.z, c[7], R0; \n"
|
||||
"MAD result.texcoord[0], vertex.position.w, c[8], R0; \n"
|
||||
"DP4 result.position.w, vertex.position, c[4]; \n"
|
||||
"DP4 result.position.z, vertex.position, c[3]; \n"
|
||||
"DP4 result.position.y, vertex.position, c[2]; \n"
|
||||
"DP4 result.position.x, vertex.position, c[1]; \n"
|
||||
"END \n"
|
||||
"# 8 instructions, 1 R-regs \n"
|
||||
;
|
||||
|
||||
|
||||
std::string projector_frag =
|
||||
"!!ARBfp1.0 \n"
|
||||
"OPTION ARB_precision_hint_nicest; \n"
|
||||
"# cgc version 2.1.0016, build date Nov 20 2008 \n"
|
||||
"# command line args: -oglsl -bestprecision -O3 -profile arbfp1 \n"
|
||||
"# source file: projector.frag \n"
|
||||
"#vendor NVIDIA Corporation \n"
|
||||
"#version 2.1.0.16 \n"
|
||||
"#profile arbfp1 \n"
|
||||
"#program main \n"
|
||||
"#semantic projMap \n"
|
||||
"#var float4 gl_TexCoord[0] : $vin.TEX0 : TEX0 : -1 : 1 \n"
|
||||
"#var float4 gl_TexCoord[1] : : : -1 : 0 \n"
|
||||
"#var float4 gl_TexCoord[2] : : : -1 : 0 \n"
|
||||
"#var float4 gl_TexCoord[3] : : : -1 : 0 \n"
|
||||
"#var float4 gl_TexCoord[4] : : : -1 : 0 \n"
|
||||
"#var float4 gl_TexCoord[5] : : : -1 : 0 \n"
|
||||
"#var float4 gl_TexCoord[6] : : : -1 : 0 \n"
|
||||
"#var float4 gl_TexCoord[7] : : : -1 : 0 \n"
|
||||
"#var float4 gl_FragColor : $vout.COLOR : COL : -1 : 1 \n"
|
||||
"#var sampler2D projMap : : texunit 0 : -1 : 1 \n"
|
||||
"#const c[0] = 0 \n"
|
||||
"PARAM c[1] = { { 0 } }; \n"
|
||||
"TEMP R0; \n"
|
||||
"TXP R0, fragment.texcoord[0], texture[0], 2D; \n"
|
||||
"CMP result.color, -fragment.texcoord[0].w, R0, c[0].x; \n"
|
||||
"END \n"
|
||||
"# 2 instructions, 1 R-regs \n"
|
||||
;
|
||||
|
||||
// Load the shaders.
|
||||
projTex = pGPU->addShaderMaterial(projector_vert.c_str(),
|
||||
projector_frag.c_str(),
|
||||
this,irr::video::EMT_TRANSPARENT_ADD_COLOR,0);
|
||||
}
|
||||
|
||||
/* DESTRUCTOR */
|
||||
CProjectiveTextures::~CProjectiveTextures()
|
||||
{
|
||||
// Remove the texture used.
|
||||
pVideo->removeTexture(texture);
|
||||
}
|
||||
|
||||
//! sets the look at target of the projector
|
||||
void CProjectiveTextures::setTarget(const irr::core::vector3df& pos)
|
||||
{
|
||||
Target = pos;
|
||||
const irr::core::vector3df toTarget = Target - getAbsolutePosition();
|
||||
}
|
||||
|
||||
//! Gets the current look at target of the projector
|
||||
const irr::core::vector3df& CProjectiveTextures::getTarget() const
|
||||
{
|
||||
return Target;
|
||||
}
|
||||
|
||||
void CProjectiveTextures::setFOV(irr::f32 f)
|
||||
{
|
||||
Fovy = f;
|
||||
recalculateProjectionMatrix();
|
||||
}
|
||||
|
||||
irr::f32 CProjectiveTextures::getFOV()
|
||||
{
|
||||
return Fovy;
|
||||
}
|
||||
|
||||
//! returns the axis aligned bounding box of this node
|
||||
const irr::core::aabbox3d<irr::f32>& CProjectiveTextures::getBoundingBox() const
|
||||
{
|
||||
return ViewArea.getBoundingBox();
|
||||
}
|
||||
|
||||
/* UPDATE */
|
||||
void CProjectiveTextures::render()
|
||||
{
|
||||
irr::core::vector3df pos = getAbsolutePosition();
|
||||
irr::core::vector3df tgtv = Target - pos;
|
||||
tgtv.normalize();
|
||||
|
||||
// if upvector and vector to the target are the same, we have a
|
||||
// problem. so solve this problem:
|
||||
irr::core::vector3df up(0.0f,0.0f,1.0f);
|
||||
|
||||
ViewArea.getTransform(irr::video::ETS_VIEW).buildCameraLookAtMatrixLH(pos,Target,up);
|
||||
|
||||
recalculateViewArea();
|
||||
|
||||
for(irr::u32 i=0; i<nodeArray.size(); ++i)
|
||||
{
|
||||
projMat.MaterialType = (irr::video::E_MATERIAL_TYPE)projTex;
|
||||
projMat.TextureLayer[0].Texture = texture;
|
||||
// projMat.TextureLayer[0].TextureWrap = ETC_CLAMP_TO_BORDER;
|
||||
|
||||
pVideo->setTransform(irr::video::ETS_WORLD,nodeArray[i]->getAbsoluteTransformation());
|
||||
pVideo->setMaterial(projMat);
|
||||
|
||||
for(irr::u32 j=0; j<nodeArray[i]->getMaterialCount(); ++j)
|
||||
pVideo->drawMeshBuffer(nodeArray[i]->getMesh()->getMeshBuffer(j));
|
||||
}
|
||||
}
|
||||
|
||||
void CProjectiveTextures::recalculateProjectionMatrix()
|
||||
{
|
||||
ViewArea.getTransform(irr::video::ETS_PROJECTION ).buildProjectionMatrixPerspectiveFovLH(Fovy,1.0f,1.0f,3000.0f);
|
||||
}
|
||||
|
||||
void CProjectiveTextures::recalculateViewArea()
|
||||
{
|
||||
ViewArea.cameraPosition = getAbsolutePosition();
|
||||
|
||||
irr::core::matrix4 m(irr::core::matrix4::EM4CONST_NOTHING);
|
||||
m.setbyproduct_nocheck(ViewArea.getTransform(irr::video::ETS_PROJECTION),ViewArea.getTransform(irr::video::ETS_VIEW));
|
||||
ViewArea.setFrom(m, true);
|
||||
}
|
||||
|
||||
void CProjectiveTextures::OnSetConstants(irr::video::IMaterialRendererServices* services,irr::s32 userData)
|
||||
{
|
||||
if(userData == 0)
|
||||
{
|
||||
irr::core::matrix4 bias;
|
||||
bias.makeIdentity();
|
||||
bias.setTranslation(irr::core::vector3df(0.5f,0.5f,0));
|
||||
bias.setScale(irr::core::vector3df(0.5f,-0.5f,1.0f));
|
||||
|
||||
irr::core::matrix4 worldViewProj;
|
||||
worldViewProj = bias * ViewArea.getTransform(irr::video::ETS_PROJECTION);
|
||||
worldViewProj *= ViewArea.getTransform(irr::video::ETS_VIEW);
|
||||
worldViewProj *= pVideo->getTransform(irr::video::ETS_WORLD);
|
||||
services->setVertexShaderConstant(reinterpret_cast<const irr::f32*>(worldViewProj.pointer()),5,4);
|
||||
}
|
||||
}
|
||||
68
rcbasic_runtime/ProjectiveTextures.h
Executable file
68
rcbasic_runtime/ProjectiveTextures.h
Executable file
@@ -0,0 +1,68 @@
|
||||
//#include "main.h"
|
||||
|
||||
#include <irrlicht.h>
|
||||
|
||||
#ifndef __CProjectiveTextures__
|
||||
#define __CProjectiveTextures__
|
||||
|
||||
class CProjectiveTextures : public irr::video::IShaderConstantSetCallBack, public irr::scene::ISceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
// Constructor / Destructor.
|
||||
CProjectiveTextures(irr::IrrlichtDevice* dev, irr::scene::ISceneNode* parent, irr::scene::ISceneManager* mgr, irr::s32 id,
|
||||
const irr::core::vector3df& position = irr::core::vector3df(0,0,0),
|
||||
const irr::core::vector3df& lookat = irr::core::vector3df(0,0,0));
|
||||
|
||||
~CProjectiveTextures();
|
||||
|
||||
//! Sets the look at target of the projector
|
||||
virtual void setTarget(const irr::core::vector3df& pos);
|
||||
|
||||
//! Gets the current look at target of the projector
|
||||
virtual const irr::core::vector3df& getTarget() const;
|
||||
|
||||
//! Sets the field of view (Default: PI / 3.5f)
|
||||
virtual void setFOV(irr::f32 f);
|
||||
|
||||
//! Gets the field of view (Default: PI / 3.5f)
|
||||
virtual irr::f32 getFOV();
|
||||
|
||||
//! Returns the axis aligned bounding box of this node
|
||||
virtual const irr::core::aabbox3d<irr::f32>& getBoundingBox() const;
|
||||
|
||||
//! Render
|
||||
virtual void render();
|
||||
|
||||
virtual void OnSetConstants(irr::video::IMaterialRendererServices* services, irr::s32 userData);
|
||||
|
||||
irr::video::ITexture* texture;
|
||||
irr::core::array<irr::scene::IMeshSceneNode*> nodeArray;
|
||||
|
||||
private:
|
||||
|
||||
int projTex;
|
||||
irr::video::SMaterial projMat;
|
||||
|
||||
protected:
|
||||
|
||||
void recalculateProjectionMatrix();
|
||||
void recalculateViewArea();
|
||||
|
||||
irr::core::vector3df Target;
|
||||
|
||||
irr::f32 Fovy; // Field of view, in radians.
|
||||
|
||||
irr::scene::SViewFrustum ViewArea;
|
||||
|
||||
irr::IrrlichtDevice * pDevice;
|
||||
irr::video::IVideoDriver * pVideo;
|
||||
irr::scene::ISceneManager * pScene;
|
||||
irr::gui::IGUIEnvironment * pGUI;
|
||||
irr::video::IGPUProgrammingServices * pGPU;
|
||||
irr::ILogger * pLog;
|
||||
irr::scene::ISceneCollisionManager * pCollision;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -4310,7 +4310,9 @@ void rcbasic_init()
|
||||
rc_audio_init();
|
||||
rc_gfx_init();
|
||||
rc_net_init();
|
||||
arr_ref_id.clear();
|
||||
arr_ref_id.clear();
|
||||
|
||||
initFXMaterials();
|
||||
}
|
||||
|
||||
void rcbasic_clean()
|
||||
@@ -4322,7 +4324,14 @@ void rcbasic_clean()
|
||||
loop_stack.empty();
|
||||
n_stack.empty();
|
||||
s_stack.empty();
|
||||
gosub_return_addr.empty();
|
||||
gosub_return_addr.empty();
|
||||
|
||||
for(int i = 0; i < rc_material.size(); i++)
|
||||
{
|
||||
if(rc_material[i].isFX && rc_material[i].shader != NULL)
|
||||
delete rc_material[i].shader;
|
||||
rc_material[i].shader = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void rcbasic_test()
|
||||
@@ -4389,7 +4398,7 @@ int main(int argc, char * argv[])
|
||||
|
||||
if(rc_filename.compare("--version")==0)
|
||||
{
|
||||
cout << "RCBASIC Runtime v4.2a" << endl;
|
||||
cout << "RCBASIC Runtime v4.2" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4443,7 +4452,7 @@ int main(int argc, char * argv[])
|
||||
|
||||
//ogles2 test
|
||||
#ifdef RC_TESTING
|
||||
rc_intern_dirChange("/home/n00b/test/SpriteShapeTest");
|
||||
rc_intern_dirChange("/home/n00b/Programs/RCBasic_v401_Linux64/examples/Simple_3D_Platformer/");
|
||||
//rc_intern_dirChange("");
|
||||
rc_filename = "main.cbc";
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,44 @@
|
||||
#ifndef RC_ACTOR_MATERIAL_H_INCLUDED
|
||||
#define RC_ACTOR_MATERIAL_H_INCLUDED
|
||||
|
||||
#include "rc_fx_materials.h"
|
||||
|
||||
//Create FX Material in given material slot
|
||||
// Return
|
||||
bool createShaderMaterial(int material_id, int fx_material_type)
|
||||
{
|
||||
if(material_id < 0 || material_id >= rc_material.size())
|
||||
return false;
|
||||
|
||||
if(!rc_material[material_id].isUsed)
|
||||
return false;
|
||||
|
||||
if(fx_material_type < RC_FX_MATERIAL_BASE_INDEX || fx_material_type >= (RC_FX_MATERIAL_BASE_INDEX + rc_shader_materials.size()))
|
||||
return false;
|
||||
|
||||
if(rc_material[material_id].shader)
|
||||
{
|
||||
delete rc_material[material_id].shader;
|
||||
rc_material[material_id].shader = NULL;
|
||||
}
|
||||
|
||||
rc_material[material_id].isFX = false;
|
||||
|
||||
int shader_index = fx_material_type - RC_FX_MATERIAL_BASE_INDEX;
|
||||
|
||||
//std::cout << "Shader Index = " << shader_index << std::endl;
|
||||
|
||||
rc_material[material_id].shader = new CShader(device, rc_shader_materials[shader_index]);
|
||||
|
||||
if(rc_material[material_id].shader)
|
||||
{
|
||||
rc_material[material_id].fxMatType = fx_material_type;
|
||||
rc_material[material_id].isFX = true;
|
||||
}
|
||||
|
||||
return rc_material[material_id].isFX;
|
||||
}
|
||||
|
||||
//set actor texture
|
||||
void rc_setActorTexture(int actor, int layer, int image_id)
|
||||
{
|
||||
@@ -64,8 +102,11 @@ void rc_setActorMaterialType(int actor, int material_type)
|
||||
if(!rc_actor[actor].mesh_node)
|
||||
return;
|
||||
|
||||
irr::video::E_MATERIAL_TYPE n = (irr::video::E_MATERIAL_TYPE) material_type;
|
||||
rc_actor[actor].mesh_node->setMaterialType(n);
|
||||
if(material_type >= 0 && material_type < MAX_DEFAULT_MATERIALS)
|
||||
{
|
||||
irr::video::E_MATERIAL_TYPE n = (irr::video::E_MATERIAL_TYPE) material_type;
|
||||
rc_actor[actor].mesh_node->setMaterialType(n);
|
||||
}
|
||||
}
|
||||
|
||||
//Set Actor Material Type
|
||||
@@ -77,7 +118,23 @@ int rc_getActorMaterialType(int actor, int material)
|
||||
if(!rc_actor[actor].mesh_node)
|
||||
return 0;
|
||||
|
||||
return (int)rc_actor[actor].mesh_node->getMaterial(material).MaterialType;
|
||||
int material_type = (int)rc_actor[actor].mesh_node->getMaterial(material).MaterialType;
|
||||
|
||||
if(material_type >= 0 && material_type < MAX_DEFAULT_MATERIALS)
|
||||
return material_type;
|
||||
else
|
||||
{
|
||||
//loop through all the fx materials on the actor
|
||||
for(int i = 0; i < rc_actor[actor].actor_fx_materials.size(); i++)
|
||||
{
|
||||
if(rc_actor[actor].actor_fx_materials[i].inUse && rc_actor[actor].actor_fx_materials[i].actor_material_index == material)
|
||||
{
|
||||
int material_id = rc_actor[actor].actor_fx_materials[i].material_id;
|
||||
return rc_material[material_id].fxMatType;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int rc_createMaterial()
|
||||
@@ -89,6 +146,12 @@ int rc_createMaterial()
|
||||
if(!rc_material[i].isUsed)
|
||||
{
|
||||
material_id = i;
|
||||
rc_material[i].isFX = false;
|
||||
if(rc_material[i].shader)
|
||||
{
|
||||
delete rc_material[i].shader;
|
||||
rc_material[i].shader = NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -99,6 +162,8 @@ int rc_createMaterial()
|
||||
rc_material_obj mat;
|
||||
mat.isUsed = true;
|
||||
mat.isReference = false;
|
||||
mat.isFX = false;
|
||||
mat.shader = NULL;
|
||||
rc_material.push_back(mat);
|
||||
}
|
||||
|
||||
@@ -110,8 +175,43 @@ void rc_deleteMaterial(int material_id)
|
||||
if(material_id < 0 || material_id >= rc_material.size())
|
||||
return;
|
||||
|
||||
if(rc_material[material_id].isFX)
|
||||
{
|
||||
//loop through the FX materials in every actor to remove this material
|
||||
for(int i = 0; i < rc_actor.size(); i++)
|
||||
{
|
||||
if(!rc_actor[i].mesh_node)
|
||||
continue;
|
||||
|
||||
for(int fx_mat = 0; fx_mat < rc_actor[i].actor_fx_materials.size(); fx_mat++)
|
||||
{
|
||||
int m_id = rc_actor[i].actor_fx_materials[fx_mat].material_id;
|
||||
|
||||
if(m_id < 0 || m_id >= rc_actor[i].mesh_node->getMaterialCount())
|
||||
continue;
|
||||
|
||||
if(m_id == material_id && rc_actor[i].actor_fx_materials[fx_mat].inUse)
|
||||
{
|
||||
int actor_mat_index = rc_actor[i].actor_fx_materials[fx_mat].actor_material_index;
|
||||
irr::video::SMaterial m;
|
||||
m.MaterialType = irr::video::EMT_SOLID;
|
||||
rc_actor[i].mesh_node->getMaterial(actor_mat_index) = m;
|
||||
rc_actor[i].actor_fx_materials[fx_mat].inUse = false;
|
||||
rc_actor[i].actor_fx_materials[fx_mat].material_id = -1;
|
||||
rc_actor[i].actor_fx_materials[fx_mat].actor_material_index = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(rc_material[material_id].shader)
|
||||
delete rc_material[material_id].shader;
|
||||
rc_material[material_id].shader = NULL;
|
||||
}
|
||||
|
||||
rc_material[material_id].isUsed = false;
|
||||
rc_material[material_id].mat = irr::video::SMaterial();
|
||||
rc_material[material_id].isFX = false;
|
||||
rc_material[material_id].fxMatType = -1;
|
||||
}
|
||||
|
||||
//Set Actor Material Type
|
||||
@@ -128,14 +228,65 @@ void rc_setActorMaterial(int actor, int material_num, int material_id)
|
||||
|
||||
if(rc_material[material_id].isUsed)
|
||||
{
|
||||
if(rc_material[material_id].isReference)
|
||||
if(rc_material[material_id].isFX)
|
||||
{
|
||||
if(rc_material[material_id].shader)
|
||||
{
|
||||
rc_actor[actor].mesh_node->getMaterial(material_num).MaterialType = (video::E_MATERIAL_TYPE)rc_material[material_id].shader->getMaterial();
|
||||
rc_material[material_id].shader->setObjectNode(rc_actor[actor].mesh_node);
|
||||
|
||||
registerSceneNodeForRTT(VideoDriver, rc_actor[actor].mesh_node, rc_material[material_id].shader->getRTTInfo(ERT_VIEW));
|
||||
|
||||
int fx_index = -1;
|
||||
int vacant_index = -1;
|
||||
for(int i = 0; i < rc_actor[actor].actor_fx_materials.size(); i++)
|
||||
{
|
||||
if(rc_actor[actor].actor_fx_materials[i].actor_material_index == material_num &&
|
||||
rc_actor[actor].actor_fx_materials[i].inUse)
|
||||
{
|
||||
fx_index = i;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!rc_actor[actor].actor_fx_materials[i].inUse)
|
||||
vacant_index = i;
|
||||
}
|
||||
|
||||
if(fx_index < 0)
|
||||
fx_index = vacant_index;
|
||||
|
||||
if(fx_index < 0)
|
||||
{
|
||||
rc_actor_fx_material_obj actor_fx_mat;
|
||||
actor_fx_mat.actor_material_index = material_num;
|
||||
actor_fx_mat.inUse = true;
|
||||
actor_fx_mat.material_id = material_id;
|
||||
rc_actor[actor].actor_fx_materials.push_back(actor_fx_mat);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc_actor[actor].actor_fx_materials[fx_index].actor_material_index = material_num;
|
||||
rc_actor[actor].actor_fx_materials[fx_index].inUse = true;
|
||||
rc_actor[actor].actor_fx_materials[fx_index].material_id = material_id;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//shader is null then I might as well make sure this material is vacant
|
||||
rc_material[material_id].isFX = false;
|
||||
rc_material[material_id].isUsed = false;
|
||||
}
|
||||
}
|
||||
else if(rc_material[material_id].isReference)
|
||||
{
|
||||
int refActor = rc_material[material_id].refActor;
|
||||
int refMatNum = rc_material[material_id].refMatNum;
|
||||
rc_actor[actor].mesh_node->getMaterial(material_num) = rc_actor[ refActor ].mesh_node->getMaterial( refMatNum );
|
||||
}
|
||||
else
|
||||
{
|
||||
rc_actor[actor].mesh_node->getMaterial(material_num) = rc_material[material_id].mat;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,6 +322,25 @@ int rc_copyActorMaterial(int actor, int material_num)
|
||||
else
|
||||
rc_material[material_id].mat = rc_actor[actor].mesh_node->getMaterial(material_num);
|
||||
|
||||
//Check if material is fx
|
||||
for(int i = 0; i < rc_actor[actor].actor_fx_materials.size(); i++)
|
||||
{
|
||||
if(!rc_actor[actor].actor_fx_materials[i].inUse)
|
||||
continue;
|
||||
|
||||
if(rc_actor[actor].actor_fx_materials[i].actor_material_index == material_num)
|
||||
{
|
||||
int fx_mat_id = rc_actor[actor].actor_fx_materials[i].material_id;
|
||||
|
||||
if(fx_mat_id >= 0 && fx_mat_id < rc_material.size())
|
||||
{
|
||||
rc_material[material_id].fxMatType = rc_material[fx_mat_id].fxMatType;
|
||||
rc_material[material_id].isFX = true;
|
||||
rc_material[material_id].shader = rc_material[fx_mat_id].shader;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return material_id;
|
||||
}
|
||||
|
||||
@@ -178,6 +348,9 @@ int rc_copyMaterial(int src_material_id)
|
||||
{
|
||||
int material_id = -1;
|
||||
|
||||
if(!rc_material[src_material_id].isUsed)
|
||||
return -1;
|
||||
|
||||
for(int i = 0; i < rc_material.size(); i++)
|
||||
{
|
||||
if(!rc_material[i].isUsed)
|
||||
@@ -203,6 +376,59 @@ int rc_copyMaterial(int src_material_id)
|
||||
else
|
||||
rc_material[material_id] = nmat;
|
||||
|
||||
if(rc_material[src_material_id].isFX)
|
||||
{
|
||||
if(!rc_material[src_material_id].shader)
|
||||
{
|
||||
rc_material[material_id].isUsed = false;
|
||||
rc_material[material_id].isReference = false;
|
||||
rc_material[material_id].isFX = false;
|
||||
rc_material[material_id].shader = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!createShaderMaterial(material_id, rc_material[src_material_id].fxMatType))
|
||||
{
|
||||
rc_material[material_id].isUsed = false;
|
||||
rc_material[material_id].isReference = false;
|
||||
rc_material[material_id].isFX = false;
|
||||
rc_material[material_id].shader = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
//Copy all the uniforms
|
||||
for(int i = 0; i < rc_material[src_material_id].shader->getUniformVariableCount(); i++)
|
||||
{
|
||||
rc_material[material_id].shader->getUniformVariable(i)->b_frag_var = rc_material[src_material_id].shader->getUniformVariable(i)->b_frag_var;
|
||||
rc_material[material_id].shader->getUniformVariable(i)->name = rc_material[src_material_id].shader->getUniformVariable(i)->name;
|
||||
rc_material[material_id].shader->getUniformVariable(i)->predefinition = rc_material[src_material_id].shader->getUniformVariable(i)->predefinition;
|
||||
rc_material[material_id].shader->getUniformVariable(i)->type = rc_material[src_material_id].shader->getUniformVariable(i)->type;
|
||||
|
||||
switch(rc_material[material_id].shader->getUniformVariable(i)->type)
|
||||
{
|
||||
case ESVT_SAMPLER2D:
|
||||
case ESVT_FLOAT:
|
||||
rc_material[material_id].shader->getUniformVariable(i)->value[0] = rc_material[src_material_id].shader->getUniformVariable(i)->value[0];
|
||||
break;
|
||||
case ESVT_VEC2:
|
||||
rc_material[material_id].shader->getUniformVariable(i)->value[0] = rc_material[src_material_id].shader->getUniformVariable(i)->value[0];
|
||||
rc_material[material_id].shader->getUniformVariable(i)->value[1] = rc_material[src_material_id].shader->getUniformVariable(i)->value[1];
|
||||
break;
|
||||
case ESVT_VEC3:
|
||||
rc_material[material_id].shader->getUniformVariable(i)->value[0] = rc_material[src_material_id].shader->getUniformVariable(i)->value[0];
|
||||
rc_material[material_id].shader->getUniformVariable(i)->value[1] = rc_material[src_material_id].shader->getUniformVariable(i)->value[1];
|
||||
rc_material[material_id].shader->getUniformVariable(i)->value[2] = rc_material[src_material_id].shader->getUniformVariable(i)->value[2];
|
||||
break;
|
||||
case ESVT_VEC4:
|
||||
rc_material[material_id].shader->getUniformVariable(i)->value[0] = rc_material[src_material_id].shader->getUniformVariable(i)->value[0];
|
||||
rc_material[material_id].shader->getUniformVariable(i)->value[1] = rc_material[src_material_id].shader->getUniformVariable(i)->value[1];
|
||||
rc_material[material_id].shader->getUniformVariable(i)->value[2] = rc_material[src_material_id].shader->getUniformVariable(i)->value[2];
|
||||
rc_material[material_id].shader->getUniformVariable(i)->value[3] = rc_material[src_material_id].shader->getUniformVariable(i)->value[3];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return material_id;
|
||||
}
|
||||
|
||||
@@ -237,6 +463,31 @@ int rc_getActorMaterial(int actor, int material_num)
|
||||
nmat.isReference = true;
|
||||
nmat.refActor = actor;
|
||||
nmat.refMatNum = material_num;
|
||||
|
||||
//Check if this material number is FX
|
||||
for(int i = 0; i < rc_actor[actor].actor_fx_materials.size(); i++)
|
||||
{
|
||||
if(!rc_actor[actor].actor_fx_materials[i].inUse)
|
||||
continue;
|
||||
|
||||
int actor_material_index = rc_actor[actor].actor_fx_materials[i].actor_material_index;
|
||||
|
||||
if(actor_material_index == material_num)
|
||||
{
|
||||
int fx_mat_id = rc_actor[actor].actor_fx_materials[i].material_id;
|
||||
|
||||
if(fx_mat_id >= 0 && fx_mat_id < rc_material.size())
|
||||
{
|
||||
if(rc_material[fx_mat_id].isUsed && rc_material[fx_mat_id].isFX)
|
||||
{
|
||||
nmat.isFX = true;
|
||||
nmat.fxMatType = rc_material[fx_mat_id].fxMatType;
|
||||
nmat.shader = rc_material[fx_mat_id].shader;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rc_material.push_back(nmat);
|
||||
}
|
||||
else
|
||||
@@ -247,6 +498,30 @@ int rc_getActorMaterial(int actor, int material_num)
|
||||
nmat.refActor = actor;
|
||||
nmat.refMatNum = material_num;
|
||||
rc_material[material_id] = nmat;
|
||||
|
||||
//Check if this material number is FX
|
||||
for(int i = 0; i < rc_actor[actor].actor_fx_materials.size(); i++)
|
||||
{
|
||||
if(!rc_actor[actor].actor_fx_materials[i].inUse)
|
||||
continue;
|
||||
|
||||
int actor_material_index = rc_actor[actor].actor_fx_materials[i].actor_material_index;
|
||||
|
||||
if(actor_material_index == material_num)
|
||||
{
|
||||
int fx_mat_id = rc_actor[actor].actor_fx_materials[i].material_id;
|
||||
|
||||
if(fx_mat_id >= 0 && fx_mat_id < rc_material.size())
|
||||
{
|
||||
if(rc_material[fx_mat_id].isUsed && rc_material[fx_mat_id].isFX)
|
||||
{
|
||||
rc_material[material_id].isFX = true;
|
||||
rc_material[material_id].fxMatType = rc_material[fx_mat_id].fxMatType;
|
||||
rc_material[material_id].shader = rc_material[fx_mat_id].shader;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return material_id;
|
||||
@@ -706,14 +981,31 @@ void rc_setMaterialType(int material_id, int mat_type)
|
||||
if(material_id < 0 || material_id >= rc_material.size())
|
||||
return;
|
||||
|
||||
if(rc_material[material_id].isReference)
|
||||
if(!rc_material[material_id].isUsed)
|
||||
return;
|
||||
|
||||
if(mat_type >= RC_FX_MATERIAL_BASE_INDEX && mat_type < (RC_FX_MATERIAL_BASE_INDEX + rc_shader_materials.size()))
|
||||
{
|
||||
int refActor = rc_material[material_id].refActor;
|
||||
int refMatNum = rc_material[material_id].refMatNum;
|
||||
rc_actor[refActor].mesh_node->getMaterial(refMatNum).MaterialType = (irr::video::E_MATERIAL_TYPE)mat_type;
|
||||
if(rc_material[material_id].isReference)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
createShaderMaterial(material_id, mat_type);
|
||||
}
|
||||
}
|
||||
else
|
||||
rc_material[material_id].mat.MaterialType = (irr::video::E_MATERIAL_TYPE)mat_type;
|
||||
{
|
||||
if(rc_material[material_id].isReference)
|
||||
{
|
||||
int refActor = rc_material[material_id].refActor;
|
||||
int refMatNum = rc_material[material_id].refMatNum;
|
||||
rc_actor[refActor].mesh_node->getMaterial(refMatNum).MaterialType = (irr::video::E_MATERIAL_TYPE)mat_type;
|
||||
}
|
||||
else
|
||||
rc_material[material_id].mat.MaterialType = (irr::video::E_MATERIAL_TYPE)mat_type;
|
||||
}
|
||||
}
|
||||
|
||||
int rc_getMaterialType(int material_id)
|
||||
@@ -725,10 +1017,46 @@ int rc_getMaterialType(int material_id)
|
||||
{
|
||||
int refActor = rc_material[material_id].refActor;
|
||||
int refMatNum = rc_material[material_id].refMatNum;
|
||||
|
||||
//Check if material is an fx material
|
||||
for(int i = 0; i < rc_actor[refActor].actor_fx_materials.size(); i++)
|
||||
{
|
||||
if(!rc_actor[refActor].actor_fx_materials[i].inUse)
|
||||
continue;
|
||||
|
||||
if(rc_actor[refActor].actor_fx_materials[i].material_id == material_id)
|
||||
{
|
||||
if(material_id >= 0 && material_id < rc_material.size())
|
||||
{
|
||||
if(rc_material[material_id].isFX)
|
||||
return rc_material[material_id].fxMatType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(rc_material[material_id].isFX)
|
||||
{
|
||||
int n = rc_actor[refActor].actor_fx_materials[0].material_id;
|
||||
if(n >= 0 && n < rc_material.size())
|
||||
{
|
||||
if(rc_material[n].isUsed)
|
||||
return rc_material[n].fxMatType;
|
||||
}
|
||||
|
||||
//std::cout << "yolo: " << rc_material[n].fxMatType << " ~ " << material_id << std::endl;
|
||||
}
|
||||
|
||||
return (int)rc_actor[refActor].mesh_node->getMaterial(refMatNum).MaterialType;
|
||||
}
|
||||
else
|
||||
return (int)rc_material[material_id].mat.MaterialType;
|
||||
{
|
||||
if(rc_material[material_id].isFX)
|
||||
{
|
||||
return rc_material[material_id].fxMatType;
|
||||
}
|
||||
else
|
||||
return (int)rc_material[material_id].mat.MaterialType;
|
||||
}
|
||||
}
|
||||
|
||||
void rc_setMaterialNormalize(int material_id, bool flag)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef RC_BASE_ACTOR_H_INCLUDED
|
||||
#define RC_BASE_ACTOR_H_INCLUDED
|
||||
|
||||
#include "ProjectiveTextures.h"
|
||||
|
||||
void setSolidProperties(int actor)
|
||||
{
|
||||
if(!rc_actor[actor].physics.isSolid)
|
||||
@@ -727,6 +729,50 @@ int rc_createLightActor()
|
||||
return actor_id;
|
||||
}
|
||||
|
||||
int rc_createProjectorActor()
|
||||
{
|
||||
int actor_id = -1;
|
||||
CProjectiveTextures* node = new CProjectiveTextures(device, 0, SceneManager, -1);
|
||||
rc_scene_node actor;
|
||||
actor.node_type = RC_NODE_TYPE_PROJECTOR;
|
||||
actor.mesh_node = node;
|
||||
actor.shadow = NULL;
|
||||
actor.transition = false;
|
||||
actor.transition_time = 0;
|
||||
actor.material_ref_index = -1;
|
||||
|
||||
if(!node)
|
||||
return -1;
|
||||
|
||||
for(int i = 0; i < rc_actor.size(); i++)
|
||||
{
|
||||
if(!rc_actor[i].mesh_node)
|
||||
{
|
||||
actor_id = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(actor_id < 0)
|
||||
{
|
||||
actor_id = rc_actor.size();
|
||||
rc_actor.push_back(actor);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc_actor[actor_id] = actor;
|
||||
}
|
||||
|
||||
//Actor RigidBody
|
||||
rc_actor[actor_id].physics.shape_type = RC_NODE_SHAPE_TYPE_BOX;
|
||||
rc_actor[actor_id].physics.rigid_body = NULL;
|
||||
rc_actor[actor_id].physics.isSolid = false;
|
||||
|
||||
rc_setActorCollisionShape(actor_id, RC_NODE_SHAPE_TYPE_BOX, 1);
|
||||
|
||||
return actor_id;
|
||||
}
|
||||
|
||||
//delete actor
|
||||
void rc_deleteActor(int actor_id)
|
||||
{
|
||||
@@ -1522,4 +1568,62 @@ void rc_setTerrainPatchLOD(int actor, int patchX, int patchZ, int lod)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void rc_setProjectorTarget(int actor, double x, double y, double z)
|
||||
{
|
||||
if(actor < 0 || actor >= rc_actor.size())
|
||||
return;
|
||||
|
||||
switch(rc_actor[actor].node_type)
|
||||
{
|
||||
case RC_NODE_TYPE_PROJECTOR:
|
||||
CProjectiveTextures* projector = (CProjectiveTextures*) rc_actor[actor].mesh_node;
|
||||
projector->setTarget(irr::core::vector3df(x,y,z));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void rc_getProjectorTarget(int actor, double* x, double* y, double* z)
|
||||
{
|
||||
if(actor < 0 || actor >= rc_actor.size())
|
||||
return;
|
||||
|
||||
switch(rc_actor[actor].node_type)
|
||||
{
|
||||
case RC_NODE_TYPE_PROJECTOR:
|
||||
CProjectiveTextures* projector = (CProjectiveTextures*) rc_actor[actor].mesh_node;
|
||||
*x = projector->getTarget().X;
|
||||
*y = projector->getTarget().Y;
|
||||
*z = projector->getTarget().Z;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void rc_setProjectorFOV(int actor, double fov)
|
||||
{
|
||||
if(actor < 0 || actor >= rc_actor.size())
|
||||
return;
|
||||
|
||||
switch(rc_actor[actor].node_type)
|
||||
{
|
||||
case RC_NODE_TYPE_PROJECTOR:
|
||||
CProjectiveTextures* projector = (CProjectiveTextures*) rc_actor[actor].mesh_node;
|
||||
return projector->setFOV(fov);
|
||||
}
|
||||
}
|
||||
|
||||
double rc_getProjectorFOV(int actor)
|
||||
{
|
||||
if(actor < 0 || actor >= rc_actor.size())
|
||||
return 0;
|
||||
|
||||
switch(rc_actor[actor].node_type)
|
||||
{
|
||||
case RC_NODE_TYPE_PROJECTOR:
|
||||
CProjectiveTextures* projector = (CProjectiveTextures*) rc_actor[actor].mesh_node;
|
||||
return projector->getFOV();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif // RC_BASE_ACTOR_H_INCLUDED
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -769,6 +769,9 @@ case FN_SetAntiAliasMode: //Sub Procedure
|
||||
case FN_GetAntiAliasMode: //Number Function
|
||||
rc_push_num(rc_getAntiAliasMode( ));
|
||||
break;
|
||||
case FN_ConvertToNormalMap: //Sub Procedure
|
||||
rc_convertToNormalMap( CONVERTTONORMALMAP_IMG_ID, CONVERTTONORMALMAP_AMP );
|
||||
break;
|
||||
case FN_InKey: //Number Function
|
||||
rc_push_num(rc_inKey( ));
|
||||
break;
|
||||
@@ -1208,6 +1211,9 @@ case FN_NumCPUs: //Number Function
|
||||
case FN_SystemRam: //Number Function
|
||||
rc_push_num(rc_intern_systemRam( ));
|
||||
break;
|
||||
case FN_GetGPUInfo$: //String Function
|
||||
rc_push_str(rc_getGPUInfo( ));
|
||||
break;
|
||||
case FN_DimMatrix: //Number Function
|
||||
rc_push_num(rc_dimMatrix( DIMMATRIX_M_ROWS, DIMMATRIX_M_COLS ));
|
||||
break;
|
||||
@@ -2102,6 +2108,9 @@ case FN_RemoveActorShadow: //Sub Procedure
|
||||
case FN_ActorExists: //Number Function
|
||||
rc_push_num(rc_actorExists( ACTOREXISTS_ACTOR ));
|
||||
break;
|
||||
case FN_CreateProjectorActor: //Number Function
|
||||
rc_push_num(rc_createProjectorActor( ));
|
||||
break;
|
||||
case FN_CreateActorAnimation: //Number Function
|
||||
rc_push_num(rc_createActorAnimation( CREATEACTORANIMATION_ACTOR, CREATEACTORANIMATION_START_FRAME, CREATEACTORANIMATION_END_FRAME, CREATEACTORANIMATION_SPEED ));
|
||||
break;
|
||||
@@ -2741,6 +2750,18 @@ case FN_GetSceneFog: //Sub Procedure
|
||||
case FN_ClearScene: //Sub Procedure
|
||||
rc_clearScene( );
|
||||
break;
|
||||
case FN_SetSceneShadowColor: //Sub Procedure
|
||||
rc_setSceneShadowColor( SETSCENESHADOWCOLOR_COLOR );
|
||||
break;
|
||||
case FN_GetSceneShadowColor: //Number Function
|
||||
rc_push_num(rc_getSceneShadowColor( ));
|
||||
break;
|
||||
case FN_SetSceneAmbientColor: //Sub Procedure
|
||||
rc_setSceneAmbientColor( SETSCENEAMBIENTCOLOR_COLOR );
|
||||
break;
|
||||
case FN_GetSceneAmbientColor: //Number Function
|
||||
rc_push_num(rc_getSceneAmbientColor( ));
|
||||
break;
|
||||
case FN_startParticleEmitter: //Sub Procedure
|
||||
rc_startParticleEmitter( STARTPARTICLEEMITTER_ACTOR );
|
||||
break;
|
||||
@@ -2960,6 +2981,18 @@ case FN_SetTerrainCameraRotationDelta: //Sub Procedure
|
||||
case FN_SetTerrainPatchLOD: //Sub Procedure
|
||||
rc_setTerrainPatchLOD( SETTERRAINPATCHLOD_ACTOR, SETTERRAINPATCHLOD_PATCHX, SETTERRAINPATCHLOD_PATCHZ, SETTERRAINPATCHLOD_LOD );
|
||||
break;
|
||||
case FN_SetProjectorTarget: //Sub Procedure
|
||||
rc_setProjectorTarget( SETPROJECTORTARGET_ACTOR, SETPROJECTORTARGET_X, SETPROJECTORTARGET_Y, SETPROJECTORTARGET_Z );
|
||||
break;
|
||||
case FN_GetProjectorTarget: //Sub Procedure
|
||||
rc_getProjectorTarget( GETPROJECTORTARGET_ACTOR, &GETPROJECTORTARGET_X, &GETPROJECTORTARGET_Y, &GETPROJECTORTARGET_Z );
|
||||
break;
|
||||
case FN_SetProjectorFOV: //Sub Procedure
|
||||
rc_setProjectorFOV( SETPROJECTORFOV_ACTOR, SETPROJECTORFOV_FOV );
|
||||
break;
|
||||
case FN_GetProjectorFOV: //Number Function
|
||||
rc_push_num(rc_getProjectorFOV( GETPROJECTORFOV_ACTOR ));
|
||||
break;
|
||||
case FN_createMaterial: //Number Function
|
||||
rc_push_num(rc_createMaterial( ));
|
||||
break;
|
||||
@@ -3137,4 +3170,16 @@ case FN_getActorMaterialType: //Number Function
|
||||
case FN_MaterialExists: //Number Function
|
||||
rc_push_num(rc_materialExists( MATERIALEXISTS_MATERIAL ));
|
||||
break;
|
||||
case FN_NumMaterialConstants: //Number Function
|
||||
rc_push_num(rc_numMaterialConstants( NUMMATERIALCONSTANTS_MATERIAL_TYPE ));
|
||||
break;
|
||||
case FN_GetMaterialConstantName$: //String Function
|
||||
rc_push_str(rc_getMaterialConstantName( GETMATERIALCONSTANTNAME$_MATERIAL_TYPE, GETMATERIALCONSTANTNAME$_INDEX ));
|
||||
break;
|
||||
case FN_SetMaterialConstant: //Sub Procedure
|
||||
rc_setMaterialConstant( SETMATERIALCONSTANT_MATERIAL, SETMATERIALCONSTANT_M_CONSTANT$, SETMATERIALCONSTANT_N1, SETMATERIALCONSTANT_N2, SETMATERIALCONSTANT_N3, SETMATERIALCONSTANT_N4 );
|
||||
break;
|
||||
case FN_GetMaterialConstant: //Sub Procedure
|
||||
rc_getMaterialConstant( GETMATERIALCONSTANT_MATERIAL, GETMATERIALCONSTANT_M_CONSTANT$, &GETMATERIALCONSTANT_N1, &GETMATERIALCONSTANT_N2, &GETMATERIALCONSTANT_N3, &GETMATERIALCONSTANT_N4 );
|
||||
break;
|
||||
|
||||
|
||||
669
rcbasic_runtime/rc_fx_materials.h
Normal file
669
rcbasic_runtime/rc_fx_materials.h
Normal file
@@ -0,0 +1,669 @@
|
||||
#ifndef RC_FX_MATERIALS_H_INCLUDED
|
||||
#define RC_FX_MATERIALS_H_INCLUDED
|
||||
|
||||
#include <irrlicht.h>
|
||||
//don't forget to include the CShader source
|
||||
#include "CShader.h"
|
||||
#include "rc_fx_shaders.h"
|
||||
|
||||
#define RC_FX_MATERIAL_BASE_INDEX 128
|
||||
|
||||
irr::core::array<rc_shader_material_obj> rc_shader_materials;
|
||||
|
||||
|
||||
//Now we have to set up a simple Render-To-Texture management
|
||||
//-----------------------------------------------------------
|
||||
//scenenode_for_rtt_view:
|
||||
//Here all scenenodes get stored which use a shader with RTT requirement.
|
||||
//This is currently just the glass refraction shader
|
||||
core::array<scene::ISceneNode*> scenenodes_for_rtt_view;
|
||||
|
||||
//tex_rtt_view:
|
||||
//The texture which holds the texture render from the view position.
|
||||
//There's currently no other RTT-type supported. Each type would need
|
||||
//its own texture.
|
||||
video::ITexture* tex_rtt_view = 0;
|
||||
|
||||
//Adds a scenenode to the RTT-queue if it has a RTT-requirement
|
||||
//These information are all provided and handled by the DynamicShader files.
|
||||
void registerSceneNodeForRTT(irr::video::IVideoDriver* rtt_driver, irr::scene::ISceneNode* node, S_RTT_Info* rtt_info)
|
||||
{
|
||||
if(node && rtt_info)
|
||||
{
|
||||
switch(rtt_info->type)
|
||||
{
|
||||
case ERT_VIEW:
|
||||
{
|
||||
if(scenenodes_for_rtt_view.size() <= 0)
|
||||
tex_rtt_view = rtt_driver->addRenderTargetTexture( core::dimension2d<u32>(256,256) );
|
||||
|
||||
scenenodes_for_rtt_view.push_back(node);
|
||||
node->setMaterialTexture(rtt_info->tex_channel,tex_rtt_view);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void init_refraction1()
|
||||
{
|
||||
rc_shader_material_obj shader_material;
|
||||
|
||||
rc_shader_obj obj;
|
||||
|
||||
obj.name = "BaseColor";
|
||||
obj.type = "vec3";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = true;
|
||||
obj.value.push_back(rc_shader_float(0.40000));
|
||||
obj.value.push_back(rc_shader_float(0.40000));
|
||||
obj.value.push_back(rc_shader_float(0.10000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "Depth";
|
||||
obj.type = "float";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = true;
|
||||
obj.value.push_back(rc_shader_float(0.10000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "MixRatio";
|
||||
obj.type = "float";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = true;
|
||||
obj.value.push_back(rc_shader_float(1.0000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "FrameHeight";
|
||||
obj.type = "float";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(255.0000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "FrameWidth";
|
||||
obj.type = "float";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(255.0000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "EnvMap";
|
||||
obj.type = "sampler2d";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "RefractionMap";
|
||||
obj.type = "predefined";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_string("predefined_rtt_view"));
|
||||
obj.additional_value.push_back(rc_shader_float(1));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
shader_material.frag_shader = refraction1_frag;
|
||||
shader_material.vert_shader = refraction1_vert;
|
||||
|
||||
rc_shader_materials.push_back(shader_material);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void init_refraction2()
|
||||
{
|
||||
rc_shader_material_obj shader_material;
|
||||
|
||||
shader_material.frag_shader = refraction2_frag;
|
||||
shader_material.vert_shader = refraction2_vert;
|
||||
|
||||
rc_shader_materials.push_back(shader_material);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void init_gooch()
|
||||
{
|
||||
rc_shader_material_obj shader_material;
|
||||
|
||||
rc_shader_obj obj;
|
||||
|
||||
obj.name = "SurfaceColor";
|
||||
obj.type = "vec3";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.75000));
|
||||
obj.value.push_back(rc_shader_float(0.75000));
|
||||
obj.value.push_back(rc_shader_float(0.75000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "WarmColor";
|
||||
obj.type = "vec3";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.60000));
|
||||
obj.value.push_back(rc_shader_float(0.60000));
|
||||
obj.value.push_back(rc_shader_float(0.00000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "CoolColor";
|
||||
obj.type = "vec3";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.00000));
|
||||
obj.value.push_back(rc_shader_float(0.00000));
|
||||
obj.value.push_back(rc_shader_float(0.60000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "DiffuseWarm";
|
||||
obj.type = "float";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.45000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "DiffuseCool";
|
||||
obj.type = "float";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.45000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
|
||||
shader_material.frag_shader = gooch_frag;
|
||||
shader_material.vert_shader = gooch_vert;
|
||||
|
||||
rc_shader_materials.push_back(shader_material);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void init_style()
|
||||
{
|
||||
rc_shader_material_obj shader_material;
|
||||
|
||||
rc_shader_obj obj;
|
||||
|
||||
obj.name = "lightPos";
|
||||
obj.type = "predefined";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_string("predefined_toonLightPos_position"));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
|
||||
shader_material.frag_shader = style_frag;
|
||||
shader_material.vert_shader = style_vert;
|
||||
|
||||
rc_shader_materials.push_back(shader_material);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void init_normalShade()
|
||||
{
|
||||
rc_shader_material_obj shader_material;
|
||||
|
||||
rc_shader_obj obj;
|
||||
|
||||
obj.name = "Alpha";
|
||||
obj.type = "float";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(1.0));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
shader_material.frag_shader = glass_frag;
|
||||
shader_material.vert_shader = glass_vert;
|
||||
|
||||
rc_shader_materials.push_back(shader_material);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void init_outline()
|
||||
{
|
||||
rc_shader_material_obj shader_material;
|
||||
|
||||
rc_shader_obj obj;
|
||||
|
||||
obj.name = "SurfaceColor";
|
||||
obj.type = "vec3";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.75000));
|
||||
obj.value.push_back(rc_shader_float(0.75000));
|
||||
obj.value.push_back(rc_shader_float(0.75000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "EnvMap";
|
||||
obj.type = "sampler2d";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
|
||||
shader_material.frag_shader = outline_frag;
|
||||
shader_material.vert_shader = outline_vert;
|
||||
|
||||
rc_shader_materials.push_back(shader_material);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void init_plastic()
|
||||
{
|
||||
rc_shader_material_obj shader_material;
|
||||
|
||||
rc_shader_obj obj;
|
||||
|
||||
obj.name = "Color";
|
||||
obj.type = "vec4";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.80000));
|
||||
obj.value.push_back(rc_shader_float(0.00000));
|
||||
obj.value.push_back(rc_shader_float(0.00000));
|
||||
obj.value.push_back(rc_shader_float(1.00000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "intensity";
|
||||
obj.type = "float";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(1.0));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
|
||||
shader_material.frag_shader = plastic_frag;
|
||||
shader_material.vert_shader = plastic_vert;
|
||||
|
||||
rc_shader_materials.push_back(shader_material);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void init_tangent()
|
||||
{
|
||||
rc_shader_material_obj shader_material;
|
||||
|
||||
rc_shader_obj obj;
|
||||
|
||||
obj.name = "matView";
|
||||
obj.type = "predefined";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_string("predefined_mat4_view"));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "bViewSpace";
|
||||
obj.type = "float";
|
||||
obj.fragVar = false;
|
||||
obj.artistVar = true;
|
||||
obj.value.push_back(rc_shader_float(1.0));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
shader_material.frag_shader = tangent_frag;
|
||||
shader_material.vert_shader = tangent_vert;
|
||||
|
||||
rc_shader_materials.push_back(shader_material);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void init_speaker()
|
||||
{
|
||||
rc_shader_material_obj shader_material;
|
||||
|
||||
rc_shader_obj obj;
|
||||
|
||||
obj.name = "view_proj_matrix";
|
||||
obj.type = "predefined";
|
||||
obj.fragVar = false;
|
||||
obj.artistVar = true;
|
||||
obj.value.push_back(rc_shader_string("predefined_mat4_view_proj"));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "view_matrix";
|
||||
obj.type = "predefined";
|
||||
obj.fragVar = false;
|
||||
obj.artistVar = true;
|
||||
obj.value.push_back(rc_shader_string("predefined_mat4_view"));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "time_0_X";
|
||||
obj.type = "predefined";
|
||||
obj.fragVar = false;
|
||||
obj.artistVar = true;
|
||||
obj.value.push_back(rc_shader_string("predefined_float_time0x"));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "pulseSharpness";
|
||||
obj.type = "float";
|
||||
obj.fragVar = false;
|
||||
obj.artistVar = true;
|
||||
obj.value.push_back(rc_shader_float(14.00000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "beat";
|
||||
obj.type = "float";
|
||||
obj.fragVar = false;
|
||||
obj.artistVar = true;
|
||||
obj.value.push_back(rc_shader_float(2.2500));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "amplitude";
|
||||
obj.type = "float";
|
||||
obj.fragVar = false;
|
||||
obj.artistVar = true;
|
||||
obj.value.push_back(rc_shader_float(2.4000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "bassFrequency";
|
||||
obj.type = "float";
|
||||
obj.fragVar = false;
|
||||
obj.artistVar = true;
|
||||
obj.value.push_back(rc_shader_float(44.0000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "base";
|
||||
obj.type = "sampler2d";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
shader_material.frag_shader = speaker_frag;
|
||||
shader_material.vert_shader = speaker_vert;
|
||||
|
||||
rc_shader_materials.push_back(shader_material);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void init_phong()
|
||||
{
|
||||
rc_shader_material_obj shader_material;
|
||||
|
||||
rc_shader_obj obj;
|
||||
|
||||
obj.name = "fvAmbient";
|
||||
obj.type = "vec4";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.3686));
|
||||
obj.value.push_back(rc_shader_float(0.3684));
|
||||
obj.value.push_back(rc_shader_float(0.3684));
|
||||
obj.value.push_back(rc_shader_float(1.0000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "fvSpecular";
|
||||
obj.type = "vec4";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.4902));
|
||||
obj.value.push_back(rc_shader_float(0.4887));
|
||||
obj.value.push_back(rc_shader_float(0.4887));
|
||||
obj.value.push_back(rc_shader_float(1.0000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "fvDiffuse";
|
||||
obj.type = "vec4";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.8863));
|
||||
obj.value.push_back(rc_shader_float(0.8850));
|
||||
obj.value.push_back(rc_shader_float(0.8850));
|
||||
obj.value.push_back(rc_shader_float(1.0000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "fSpecularPower";
|
||||
obj.type = "float";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(25.0000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "baseMap";
|
||||
obj.type = "sampler2d";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.0000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "fvEyePosition";
|
||||
obj.type = "predefined";
|
||||
obj.fragVar = false;
|
||||
obj.artistVar = true;
|
||||
obj.value.push_back(rc_shader_string("predefined_eye_position"));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
shader_material.frag_shader = tx_phong_frag;
|
||||
shader_material.vert_shader = tx_phong_vert;
|
||||
|
||||
rc_shader_materials.push_back(shader_material);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void init_style2()
|
||||
{
|
||||
rc_shader_material_obj shader_material;
|
||||
|
||||
rc_shader_obj obj;
|
||||
|
||||
obj.name = "baseMap";
|
||||
obj.type = "sampler2d";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.0000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
shader_material.frag_shader = style2_frag;
|
||||
shader_material.vert_shader = style2_vert;
|
||||
|
||||
rc_shader_materials.push_back(shader_material);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void init_style3()
|
||||
{
|
||||
rc_shader_material_obj shader_material;
|
||||
|
||||
rc_shader_obj obj;
|
||||
|
||||
shader_material.frag_shader = style3_frag;
|
||||
shader_material.vert_shader = style3_vert;
|
||||
|
||||
rc_shader_materials.push_back(shader_material);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void init_style4()
|
||||
{
|
||||
rc_shader_material_obj shader_material;
|
||||
|
||||
rc_shader_obj obj;
|
||||
|
||||
obj.name = "silhouetteThreshold";
|
||||
obj.type = "float";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.2000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "silhouetteColor";
|
||||
obj.type = "vec4";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(1.0000));
|
||||
obj.value.push_back(rc_shader_float(1.0000));
|
||||
obj.value.push_back(rc_shader_float(1.0000));
|
||||
obj.value.push_back(rc_shader_float(1.0000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "enableLighting";
|
||||
obj.type = "float";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(1.0000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
obj.name = "tex";
|
||||
obj.type = "sampler2d";
|
||||
obj.fragVar = true;
|
||||
obj.artistVar = false;
|
||||
obj.value.push_back(rc_shader_float(0.0000));
|
||||
shader_material.shader_object.push_back(obj);
|
||||
obj.value.clear();
|
||||
obj.additional_value.clear();
|
||||
|
||||
shader_material.frag_shader = style4_frag;
|
||||
shader_material.vert_shader = style4_vert;
|
||||
|
||||
rc_shader_materials.push_back(shader_material);
|
||||
}
|
||||
|
||||
|
||||
void initFXMaterials()
|
||||
{
|
||||
//IMPORTANT NOTE: THESE HAVE TO BE ADDED IN THIS ORDER SO THEY MATCH THE ORDER I SPECIFIED FOR THE CONSTANTS IN THE TOKENIZER
|
||||
|
||||
init_normalShade(); //FX_MATERIAL_TYPE_NORMAL_BLEND
|
||||
init_refraction1(); //FX_MATERIAL_TYPE_REFRACTION
|
||||
init_refraction2(); //FX_MATERIAL_TYPE_REFRACTION2
|
||||
init_gooch(); //FX_MATERIAL_TYPE_GOOCH
|
||||
init_plastic(); //FX_MATERIAL_TYPE_PLASTIC
|
||||
init_tangent(); //FX_MATERIAL_TYPE_TANGENT
|
||||
init_speaker(); //FX_MATERIAL_TYPE_SPEAKER
|
||||
init_phong(); //FX_MATERIAL_TYPE_PHONG_TEXTURE
|
||||
init_style(); //FX_MATERIAL_TYPE_STYLE
|
||||
init_style2(); //FX_MATERIAL_TYPE_STYLE2
|
||||
init_style3(); //FX_MATERIAL_TYPE_STYLE3
|
||||
init_style4(); //FX_MATERIAL_TYPE_STYLE4
|
||||
}
|
||||
|
||||
|
||||
int rc_numMaterialConstants(int material_type)
|
||||
{
|
||||
if(material_type < RC_FX_MATERIAL_BASE_INDEX || material_type >= (RC_FX_MATERIAL_BASE_INDEX + rc_shader_materials.size()))
|
||||
return 0;
|
||||
|
||||
int shader_m_id = material_type - RC_FX_MATERIAL_BASE_INDEX;
|
||||
return rc_shader_materials[shader_m_id].shader_object.size();
|
||||
}
|
||||
|
||||
std::string rc_getMaterialConstantName(int material_type, int index)
|
||||
{
|
||||
if(material_type < RC_FX_MATERIAL_BASE_INDEX || material_type >= (RC_FX_MATERIAL_BASE_INDEX + rc_shader_materials.size()))
|
||||
return "";
|
||||
|
||||
int shader_m_id = material_type - RC_FX_MATERIAL_BASE_INDEX;
|
||||
if(index < 0 || index >= rc_shader_materials[shader_m_id].shader_object.size())
|
||||
return "";
|
||||
|
||||
return rc_intern_ucase(rc_shader_materials[shader_m_id].shader_object[index].name);
|
||||
}
|
||||
|
||||
void rc_setMaterialConstant(int material_id, std::string m_constant, double n1, double n2, double n3, double n4)
|
||||
{
|
||||
}
|
||||
|
||||
void rc_getMaterialConstant(int material_id, std::string m_constant, double* n1, double* n2, double* n3, double* n4)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif // RC_FX_MATERIALS_H_INCLUDED
|
||||
807
rcbasic_runtime/rc_fx_shaders.h
Normal file
807
rcbasic_runtime/rc_fx_shaders.h
Normal file
@@ -0,0 +1,807 @@
|
||||
#ifndef RC_FX_SHADERS_H_INCLUDED
|
||||
#define RC_FX_SHADERS_H_INCLUDED
|
||||
|
||||
std::string refraction1_vert =
|
||||
"varying vec3 Normal; \n"
|
||||
"varying vec3 EyeDir; \n"
|
||||
"varying vec4 EyePos; \n"
|
||||
"varying float LightIntensity; \n"
|
||||
"\n"
|
||||
"void main(void) \n"
|
||||
"{ \n"
|
||||
" gl_Position = ftransform(); \n"
|
||||
" Normal = normalize(gl_NormalMatrix * gl_Normal); \n"
|
||||
" vec4 pos = gl_ModelViewMatrix * gl_Vertex; \n"
|
||||
" EyeDir = pos.xyz; \n"
|
||||
" EyePos = gl_ModelViewProjectionMatrix * gl_Vertex; \n"
|
||||
" LightIntensity = max(dot(normalize(gl_LightSource[0].position.xyz - EyeDir), Normal), 0.0); \n"
|
||||
"}";
|
||||
|
||||
std::string refraction1_frag =
|
||||
"const vec3 Xunitvec = vec3 (1.0, 0.0, 0.0); \n"
|
||||
"const vec3 Yunitvec = vec3 (0.0, 1.0, 0.0); \n"
|
||||
" \n"
|
||||
"uniform vec3 BaseColor; \n"
|
||||
"uniform float Depth; \n"
|
||||
"uniform float MixRatio; \n"
|
||||
" \n"
|
||||
"// need to scale our framebuffer - it has a fixed width/height of 2048 \n"
|
||||
"uniform float FrameWidth; \n"
|
||||
"uniform float FrameHeight; \n"
|
||||
" \n"
|
||||
"uniform sampler2D EnvMap; \n"
|
||||
"uniform sampler2D RefractionMap; \n"
|
||||
" \n"
|
||||
"varying vec3 Normal; \n"
|
||||
"varying vec3 EyeDir; \n"
|
||||
"varying vec4 EyePos; \n"
|
||||
"varying float LightIntensity; \n"
|
||||
" \n"
|
||||
"void main (void) \n"
|
||||
"{ \n"
|
||||
" // Compute reflection vector \n"
|
||||
" vec3 reflectDir = reflect(EyeDir, Normal); \n"
|
||||
" \n"
|
||||
" // Compute altitude and azimuth angles \n"
|
||||
" \n"
|
||||
" vec2 index; \n"
|
||||
" \n"
|
||||
" index.y = dot(normalize(reflectDir), Yunitvec); \n"
|
||||
" reflectDir.y = 0.0; \n"
|
||||
" index.x = dot(normalize(reflectDir), Xunitvec) * 0.5; \n"
|
||||
" \n"
|
||||
" // Translate index values into proper range \n"
|
||||
" \n"
|
||||
" if (reflectDir.z >= 0.0) \n"
|
||||
" index = (index + 1.0) * 0.5; \n"
|
||||
" else \n"
|
||||
" { \n"
|
||||
" index.t = (index.t + 1.0) * 0.5; \n"
|
||||
" index.s = (-index.s) * 0.5 + 1.0; \n"
|
||||
" } \n"
|
||||
" \n"
|
||||
" // if reflectDir.z >= 0.0, s will go from 0.25 to 0.75 \n"
|
||||
" // if reflectDir.z < 0.0, s will go from 0.75 to 1.25, and \n"
|
||||
" // that's OK, because we've set the texture to wrap. \n"
|
||||
" \n"
|
||||
" // Do a lookup into the environment map. \n"
|
||||
" \n"
|
||||
" vec3 envColor = vec3 (texture2D(EnvMap, index)); \n"
|
||||
" \n"
|
||||
" // calc fresnels term. This allows a view dependant blend of reflection/refraction \n"
|
||||
" float fresnel = abs(dot(normalize(EyeDir), Normal)); \n"
|
||||
" fresnel *= MixRatio; \n"
|
||||
" fresnel = clamp(fresnel, 0.1, 0.9); \n"
|
||||
" \n"
|
||||
" // calc refraction \n"
|
||||
" vec3 refractionDir = normalize(EyeDir) - normalize(Normal); \n"
|
||||
" \n"
|
||||
" // Scale the refraction so the z element is equal to depth \n"
|
||||
" float depthVal = Depth / -refractionDir.z; \n"
|
||||
" \n"
|
||||
" // perform the div by w \n"
|
||||
" float recipW = 1.0 / EyePos.w; \n"
|
||||
" vec2 eye = EyePos.xy * vec2(recipW); \n"
|
||||
" \n"
|
||||
" // calc the refraction lookup \n"
|
||||
" index.s = (eye.x + refractionDir.x * depthVal); \n"
|
||||
" index.t = (eye.y + refractionDir.y * depthVal); \n"
|
||||
" \n"
|
||||
" // scale and shift so we're in the range 0-1 \n"
|
||||
" index.s = index.s / 2.0 + 0.5; \n"
|
||||
" index.t = index.t / 2.0 + 0.5; \n"
|
||||
" \n"
|
||||
" // as we're looking at the framebuffer, we want it clamping at the edge of the rendered scene, not the edge of the texture, \n"
|
||||
" // so we clamp before scaling to fit \n"
|
||||
" float recip1k = 1.0 / 255.0; \n"
|
||||
" index.s = clamp(index.s, 0.0, 1.0 - recip1k); \n"
|
||||
" index.t = clamp(index.t, 0.0, 1.0 - recip1k); \n"
|
||||
" \n"
|
||||
" // scale the texture so we just see the rendered framebuffer \n"
|
||||
" index.s = index.s * FrameWidth * recip1k; \n"
|
||||
" index.t = index.t * FrameHeight * recip1k; \n"
|
||||
" \n"
|
||||
" vec3 RefractionColor = vec3 (texture2D(RefractionMap, index)); \n"
|
||||
" \n"
|
||||
" // Add lighting to base color and mix \n"
|
||||
" vec3 base = LightIntensity * BaseColor; \n"
|
||||
" envColor = mix(envColor, RefractionColor, fresnel); \n"
|
||||
" envColor = mix(envColor, base, 0.2); \n"
|
||||
" \n"
|
||||
" gl_FragColor = vec4 (envColor, 1.0); \n"
|
||||
"}";
|
||||
|
||||
|
||||
|
||||
std::string refraction2_frag =
|
||||
"varying vec3 vertex_light_position; \n"
|
||||
"varying vec3 vertex_normal; \n"
|
||||
"\n"
|
||||
"void main() { \n"
|
||||
" // Set the diffuse value (darkness). This is done with a dot product between the normal and the light \n"
|
||||
" // and the maths behind it is explained in the maths section of the site. \n"
|
||||
" float diffuse_value = max(dot(vertex_normal, vertex_light_position), 0.0); \n"
|
||||
"\n"
|
||||
" // Set the output color of our current pixel \n"
|
||||
" gl_FragColor = gl_Color * diffuse_value; \n"
|
||||
"}";
|
||||
|
||||
std::string refraction2_vert =
|
||||
"varying vec3 vertex_light_position; \n"
|
||||
"varying vec3 vertex_normal; \n"
|
||||
"\n"
|
||||
"void main() { \n"
|
||||
" // Calculate the normal value for this vertex, in world coordinates (multiply by gl_NormalMatrix) \n"
|
||||
" vertex_normal = normalize(gl_NormalMatrix * gl_Normal); \n"
|
||||
" // Calculate the light position for this vertex \n"
|
||||
" vertex_light_position = normalize(gl_LightSource[0].position.xyz); \n"
|
||||
"\n"
|
||||
" // Set the front color to the color passed through with glColor*f \n"
|
||||
" gl_FrontColor = gl_Color; \n"
|
||||
" // Set the position of the current vertex \n"
|
||||
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; \n"
|
||||
"}";
|
||||
|
||||
|
||||
|
||||
std::string gooch_vert =
|
||||
"varying float NdotL; \n"
|
||||
"varying vec3 ReflectVec; \n"
|
||||
"varying vec3 ViewVec; \n"
|
||||
"\n"
|
||||
"void main(void) \n"
|
||||
"{ \n"
|
||||
" vec3 ecPos = vec3 (gl_ModelViewMatrix * gl_Vertex); \n"
|
||||
" vec3 tnorm = normalize(gl_NormalMatrix * gl_Normal); \n"
|
||||
" vec3 lightVec = normalize(gl_LightSource[0].position.xyz - ecPos); \n"
|
||||
" ReflectVec = normalize(reflect(-lightVec, tnorm)); \n"
|
||||
" ViewVec = normalize(-ecPos); \n"
|
||||
" NdotL = (dot(lightVec, tnorm) + 1.0) * 0.5; \n"
|
||||
" gl_Position = ftransform(); \n"
|
||||
"}";
|
||||
|
||||
std::string gooch_frag =
|
||||
"uniform vec3 SurfaceColor; // (0.75, 0.75, 0.75) \n"
|
||||
"uniform vec3 WarmColor; // (0.6, 0.6, 0.0) \n"
|
||||
"uniform vec3 CoolColor; // (0.0, 0.0, 0.6) \n"
|
||||
"uniform float DiffuseWarm; // 0.45 \n"
|
||||
"uniform float DiffuseCool; // 0.45 \n"
|
||||
"\n"
|
||||
"varying float NdotL; \n"
|
||||
"varying vec3 ReflectVec; \n"
|
||||
"varying vec3 ViewVec; \n"
|
||||
"\n"
|
||||
"void main (void) \n"
|
||||
"{ \n"
|
||||
" vec3 kcool = min(CoolColor + DiffuseCool * SurfaceColor, 1.0); \n"
|
||||
" vec3 kwarm = min(WarmColor + DiffuseWarm * SurfaceColor, 1.0); \n"
|
||||
" vec3 kfinal = mix(kcool, kwarm, NdotL); \n"
|
||||
"\n"
|
||||
" vec3 nreflect = normalize(ReflectVec); \n"
|
||||
" vec3 nview = normalize(ViewVec); \n"
|
||||
"\n"
|
||||
" float spec = max(dot(nreflect, nview), 0.0); \n"
|
||||
" spec = pow(spec, 32.0); \n"
|
||||
"\n"
|
||||
" gl_FragColor = vec4 (min(kfinal + spec, 1.0), 1.0); \n"
|
||||
"}";
|
||||
|
||||
|
||||
|
||||
// OpenGL Vertex Program 1.1
|
||||
std::string style_vert =
|
||||
"//The vertex shader\n"
|
||||
"varying vec3 normalVec;\n"
|
||||
"varying vec3 vertVec;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" vertVec = gl_Vertex.xyz; \n"
|
||||
" normalVec = gl_Normal;\n"
|
||||
" gl_TexCoord[0] = gl_MultiTexCoord0;\n"
|
||||
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
|
||||
"}";
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// OpenGL Fragment Program 1.1
|
||||
std::string style_frag =
|
||||
"// Pixel shader\n"
|
||||
"// based on http://www.clockworkcoders.com/oglsl/tutorial10.htm\n"
|
||||
"\n"
|
||||
"uniform sampler2D tex;\n"
|
||||
"uniform vec3 lightPos;\n "
|
||||
"varying vec3 normalVec; \n"
|
||||
"varying vec3 vertVec;\n"
|
||||
"\n"
|
||||
"void main() \n"
|
||||
"{ \n"
|
||||
" vec4 colorTex = texture2D(tex, vec2(gl_TexCoord[0].st)); \n"
|
||||
" vec3 eyePos = lightPos; //second light \n "
|
||||
"\n"
|
||||
" eyePos.y += 1.0; // shifting second light up \n"
|
||||
"\n"
|
||||
" vec3 eyeVec = normalize(eyePos - vertVec); \n"
|
||||
" vec3 lightVec = normalize(lightPos - vertVec); \n "
|
||||
"\n"
|
||||
" // Silhouette / outline color: \n"
|
||||
" vec4 black = vec4(0.0, 0.0, 0.0, 1.0); \n"
|
||||
"\n "
|
||||
" // Angle for silhouette \n"
|
||||
" float s = max(dot(normalVec, eyeVec),0.0); \n"
|
||||
" // angle for diffuse light \n"
|
||||
" float diffuse = max(dot(normalVec, lightVec), 0.0); \n "
|
||||
"\n"
|
||||
" //Ambient color \n"
|
||||
" gl_FragColor = (colorTex)*1.4; \n"
|
||||
"\n"
|
||||
" if (s < 0.25) { \n"
|
||||
" gl_FragColor = black; \n"
|
||||
" } else { \n"
|
||||
" // Diffuse part \n"
|
||||
" if (diffuse < 0.5) { \n"
|
||||
" gl_FragColor *= 0.4; \n"
|
||||
" } \n"
|
||||
" // Specular part \n"
|
||||
" if (s < 0.9) {\n"
|
||||
" gl_FragColor *= 0.8;\n"
|
||||
" } else { // light is directly above the vertex \n"
|
||||
" gl_FragColor *= 1.4; // make it very bright \n"
|
||||
" } \n"
|
||||
" } \n"
|
||||
"}";
|
||||
|
||||
|
||||
|
||||
std::string glass_vert =
|
||||
"varying vec3 fvNormal;\n"
|
||||
"varying vec3 fvViewVec;\n"
|
||||
"void main( void )\n"
|
||||
"{\n"
|
||||
" float dist = 0.00087; \n" //maybe this value must be changed depending on the world size
|
||||
" gl_Position = ftransform();\n"
|
||||
" fvNormal = gl_NormalMatrix * gl_Normal;\n"
|
||||
" fvViewVec = vec3(dist * gl_ModelViewMatrix * gl_Vertex);\n"
|
||||
"}\n"
|
||||
;
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// OpenGL Fragment Program 1.1
|
||||
std::string glass_frag =
|
||||
"uniform float Alpha; \n"
|
||||
"varying vec3 fvNormal; \n"
|
||||
"varying vec3 fvViewVec; \n"
|
||||
"\n"
|
||||
"void main( void ) \n"
|
||||
"{\n"
|
||||
" vec4 color; \n"
|
||||
" vec4 temp; \n"
|
||||
" temp.xyz=-normalize(fvNormal); \n"
|
||||
" color.r=temp.r+0.5; \n"
|
||||
" color.g=temp.g+0.5; \n"
|
||||
" color.b=temp.b+0.5; \n"
|
||||
" color.a=Alpha; \n"
|
||||
" float t=(1.0-fvViewVec.z)/2.0; \n"
|
||||
" if(t<0.0){t=0.0;} \n"
|
||||
" gl_FragColor = color; \n"
|
||||
"}\n"
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
std::string outline_vert =
|
||||
"#version 330 \n"
|
||||
"\n"
|
||||
"layout (location = 0) in vec3 position; \n"
|
||||
"layout (location = 1) in vec4 normal; \n"
|
||||
"layout (location = 2) in vec2 uv; \n"
|
||||
"\n"
|
||||
"out vec2 vsUV; \n"
|
||||
"\n"
|
||||
"void main() \n"
|
||||
"{ \n"
|
||||
" gl_Position = vec4(position, 1.0); \n"
|
||||
" vsUV = (position.xy * 0.5) + 0.5; \n"
|
||||
"}"
|
||||
;
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// OpenGL Fragment Program 1.1
|
||||
std::string outline_frag =
|
||||
"#version 330 \n"
|
||||
" \n"
|
||||
"out vec4 fsColor; \n"
|
||||
" \n"
|
||||
"in vec2 vsUV; \n"
|
||||
" \n"
|
||||
"uniform vec2 viewportSize; \n"
|
||||
" \n"
|
||||
"#define LINE_WEIGHT 4.0 \n"
|
||||
" \n"
|
||||
"uniform sampler2D gbufferNormals; \n"
|
||||
"uniform sampler2D gbufferAlbedo; \n"
|
||||
"uniform sampler2D gbufferMask; \n"
|
||||
" \n"
|
||||
"void main() \n"
|
||||
"{ \n"
|
||||
" float dx = (1.0 / viewportSize.x) * LINE_WEIGHT; \n"
|
||||
" float dy = (1.0 / viewportSize.y) * LINE_WEIGHT; \n"
|
||||
" \n"
|
||||
" vec2 uvCenter = vsUV; \n"
|
||||
" vec2 uvRight = vec2(uvCenter.x + dx, uvCenter.y); \n"
|
||||
" vec2 uvTop = vec2(uvCenter.x, uvCenter.y - dx); \n"
|
||||
" vec2 uvTopRight = vec2(uvCenter.x + dx, uvCenter.y - dx); \n"
|
||||
" \n"
|
||||
" vec3 mCenter = texture(gbufferNormals, uvCenter).rgb; \n"
|
||||
" vec3 mTop = texture(gbufferNormals, uvTop).rgb; \n"
|
||||
" vec3 mRight = texture(gbufferNormals, uvRight).rgb; \n"
|
||||
" vec3 mTopRight = texture(gbufferNormals, uvTopRight).rgb; \n"
|
||||
" \n"
|
||||
" vec3 dT = abs(mCenter - mTop); \n"
|
||||
" vec3 dR = abs(mCenter - mRight); \n"
|
||||
" vec3 dTR = abs(mCenter - mTopRight); \n"
|
||||
" \n"
|
||||
" float dTmax = max(dT.x, max(dT.y, dT.z)); \n"
|
||||
" float dRmax = max(dR.x, max(dR.y, dR.z)); \n"
|
||||
" float dTRmax = max(dTR.x, max(dTR.y, dTR.z)); \n"
|
||||
" \n"
|
||||
" float deltaRaw = 0.0; \n"
|
||||
" deltaRaw = max(deltaRaw, dTmax); \n"
|
||||
" deltaRaw = max(deltaRaw, dRmax); \n"
|
||||
" deltaRaw = max(deltaRaw, dTRmax); \n"
|
||||
" \n"
|
||||
" // Lower threshold values will discard fewer samples \n"
|
||||
" // and give darker/thicker lines. \n"
|
||||
" float threshold = 0.8; \n"
|
||||
" float deltaClipped = clamp((deltaRaw * 2.0) - threshold, 0.0, 1.0); \n"
|
||||
" \n"
|
||||
" float oI = deltaClipped; \n"
|
||||
" vec4 outline = vec4(oI, oI, oI, 1.0); \n"
|
||||
" vec4 albedo = texture(gbufferAlbedo, vsUV); \n"
|
||||
" fsColor = albedo - outline; \n"
|
||||
"} \n"
|
||||
;
|
||||
|
||||
|
||||
|
||||
std::string plastic_vert =
|
||||
"varying vec3 tnorm; \n"
|
||||
"varying vec3 lightVec; \n"
|
||||
"void main(void) \n"
|
||||
"{ \n"
|
||||
" vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Vertex); \n"
|
||||
" tnorm = normalize(gl_NormalMatrix * gl_Normal); \n"
|
||||
" lightVec = normalize(vec3(gl_ModelViewMatrix * gl_LightSource[0].position) - ecPosition); \n"
|
||||
" gl_Position = ftransform(); \n"
|
||||
"}";
|
||||
|
||||
std::string plastic_frag =
|
||||
"uniform vec4 Color; \n"
|
||||
"uniform float intensity; \n"
|
||||
"varying vec3 tnorm; \n"
|
||||
"varying vec3 lightVec; \n"
|
||||
"void main(void) \n"
|
||||
"{ \n"
|
||||
" float v = 0.5 * (1.0 + dot(normalize(lightVec), tnorm)); \n"
|
||||
" v = pow(v,intensity); \n"
|
||||
" gl_FragColor = v * Color; \n"
|
||||
"}";
|
||||
|
||||
|
||||
|
||||
std::string tangent_vert =
|
||||
"uniform mat4 matView; \n"
|
||||
"uniform float bViewSpace; \n"
|
||||
" \n"
|
||||
"varying vec2 TexCoord; \n"
|
||||
"varying vec3 Normal; \n"
|
||||
"varying vec3 Binormal; \n"
|
||||
"varying vec3 Tangent; \n"
|
||||
" \n"
|
||||
"//attribute vec3 rm_Binormal; \n"
|
||||
"//attribute vec3 rm_Tangent; \n"
|
||||
" \n"
|
||||
"void main( void ) \n"
|
||||
"{ \n"
|
||||
" mat4 matTransform = mat4( 1.0, 0.0, 0.0, 0.0, \n"
|
||||
" 0.0, 1.0, 0.0, 0.0, \n"
|
||||
" 0.0, 0.0, 1.0, 0.0, \n"
|
||||
" 0.0, 0.0, 0.0, 1.0 ); \n"
|
||||
" \n"
|
||||
" vec3 rm_Tangent = gl_MultiTexCoord1.xyz; \n"
|
||||
" vec3 rm_Binormal = -gl_MultiTexCoord2.xyz; \n"
|
||||
" \n"
|
||||
" \n"
|
||||
" if( bViewSpace != 0.0 ) \n"
|
||||
" { \n"
|
||||
" matTransform = matView; \n"
|
||||
" } // end if ( bViewSpace ) \n"
|
||||
" \n"
|
||||
" gl_Position = ftransform(); \n"
|
||||
" TexCoord = gl_MultiTexCoord0.xy; \n"
|
||||
" Normal = ( ( matTransform * vec4( gl_Normal.xyz, 1.0 ) ).xyz + 1.0 ) / 2.0; \n"
|
||||
" Binormal = ( ( matTransform * vec4( rm_Binormal.xyz, 1.0 ) ).xyz + 1.0 ) / 2.0; \n"
|
||||
" Tangent = ( ( matTransform * vec4( rm_Tangent.xyz, 1.0 ) ).xyz + 1.0 ) / 2.0; \n"
|
||||
" \n"
|
||||
"} \n"
|
||||
;
|
||||
|
||||
std::string tangent_frag =
|
||||
"varying vec2 TexCoord; \n"
|
||||
"varying vec3 Normal; \n"
|
||||
"varying vec3 Binormal; \n"
|
||||
"varying vec3 Tangent; \n"
|
||||
" \n"
|
||||
"void main( void ) \n"
|
||||
"{ \n"
|
||||
" vec4 color = vec4( 0.0, 0.0, 0.0, 1.0 ); \n"
|
||||
" \n"
|
||||
" //color.xy = TexCoord; \n"
|
||||
" //color.xyz = Normal; \n"
|
||||
" //color.xyz = Binormal; \n"
|
||||
" color.xyz = Tangent; \n"
|
||||
" \n"
|
||||
" gl_FragColor = color; \n"
|
||||
" \n"
|
||||
"} \n"
|
||||
;
|
||||
|
||||
|
||||
std::string speaker_vert =
|
||||
"uniform mat4 view_proj_matrix; \n"
|
||||
"uniform mat4 view_matrix; \n"
|
||||
"uniform float time_0_X; \n"
|
||||
"uniform float pulseSharpness; \n"
|
||||
"uniform float bassFrequency; \n"
|
||||
"uniform float amplitude; \n"
|
||||
"uniform float beat; \n"
|
||||
" \n"
|
||||
"varying vec2 vTexCoord; \n"
|
||||
"varying vec3 vNormalES; \n"
|
||||
"varying vec3 vViewVec; \n"
|
||||
"varying vec3 vLightDir; \n"
|
||||
" \n"
|
||||
"// Sample offsets to generate the normal \n"
|
||||
"const vec2 offY = vec2(0.0, 0.1); \n"
|
||||
"const vec2 offZ = vec2(0.1, 0.0); \n"
|
||||
" \n"
|
||||
"// 2 * pi \n"
|
||||
"const float PI2 = 6.2831853; \n"
|
||||
" \n"
|
||||
" \n"
|
||||
"float getX(vec2 pos, float pulse) \n"
|
||||
"{ \n"
|
||||
" // Speaker shape \n"
|
||||
" float d = length(pos); \n"
|
||||
" float x = 15.0 * smoothstep(20.0, 25.0, d) \n"
|
||||
" - 0.4 * smoothstep(30.0, 62.0, d) * d; \n"
|
||||
" \n"
|
||||
" // Add the pulse making it stronger towards the center of the speaker \n"
|
||||
" return x + pulse * sqrt(80.0 - d); \n"
|
||||
"} \n"
|
||||
" \n"
|
||||
"void main(void) \n"
|
||||
"{ \n"
|
||||
" vec4 Pos = gl_Vertex; \n"
|
||||
" \n"
|
||||
" // Our model isn't centered around origin, so we'll move it \n"
|
||||
" // there before doing anything. \n"
|
||||
" //Pos.y += 3.0; \n"
|
||||
" //Pos.z -= 6.4; \n"
|
||||
" \n"
|
||||
" float t = fract(beat * time_0_X); \n"
|
||||
" \n"
|
||||
" // Create a pulse function, that is. starts from 0, does a \n"
|
||||
" // sharp rise to 1 and a less sharp decline back to 0 again, \n"
|
||||
" // Using f(t) = t * (1 - t)^p will suit us for this. \n"
|
||||
" // We want this curve to reach a value of 1 at its maximum in \n"
|
||||
" // the 0 < r < 1 interval. So we'll need to find the maximum \n"
|
||||
" // value in this interval, invert and multiply with the curve. \n"
|
||||
" // Those interested in math might want to derive the invMax \n"
|
||||
" // calculation below themselves by solving for f'(t) = 0 \n"
|
||||
" // and inserting into the function. \n"
|
||||
" float invMax = (pulseSharpness + 1.0) * pow(1.0 + 1.0 / pulseSharpness, pulseSharpness); \n"
|
||||
" float pulse = amplitude * invMax * t * pow(1.0 - t, pulseSharpness); \n"
|
||||
" \n"
|
||||
" // Swing the pulse at a certain frequency \n"
|
||||
" pulse *= sin(bassFrequency * PI2 * time_0_X); \n"
|
||||
" \n"
|
||||
" // Sample at three positions ... \n"
|
||||
" float x0 = getX(Pos.yz, pulse); \n"
|
||||
"//#define BOMB \n"
|
||||
"#ifdef BOMB \n"
|
||||
" //float x1 = getX(Pos.yz + offY, pulse); \n"
|
||||
" //float x2 = getX(Pos.yz + offZ, pulse); \n"
|
||||
" \n"
|
||||
"#else \n"
|
||||
" float d = length(Pos.yz + offY); \n"
|
||||
" float x = 15.0 * smoothstep(20.0, 25.0, d) - 0.4 * smoothstep(30.0, 62.0, d) * d; \n"
|
||||
" \n"
|
||||
" // Add the pulse making it stronger towards the center of the speaker \n"
|
||||
" float x1 = x + pulse * sqrt(80.0 - d); \n"
|
||||
" \n"
|
||||
" d = length(Pos.yz + offZ); \n"
|
||||
" x = 15.0 * smoothstep(20.0, 25.0, d) - 0.4 * smoothstep(30.0, 62.0, d) * d; \n"
|
||||
" \n"
|
||||
" // Add the pulse making it stronger towards the center of the speaker \n"
|
||||
" float x2 = x + pulse * sqrt(80.0 - d); \n"
|
||||
"#endif \n"
|
||||
" //Pos.x = x0; \n"
|
||||
" \n"
|
||||
" // .. then form the tangent and binormal vectors \n"
|
||||
" vec3 tangent = vec3(x1 - x0, offY); \n"
|
||||
" vec3 binormal = vec3(x2 - x0, offZ); \n"
|
||||
" \n"
|
||||
" // ... which will give us our normal \n"
|
||||
" vec3 normal; \n"
|
||||
" //normal = tangent; \n"
|
||||
" normal = normalize(cross(tangent, binormal)); \n"
|
||||
" \n"
|
||||
" gl_Position = gl_ModelViewProjectionMatrix * Pos; \n"
|
||||
" \n"
|
||||
" vTexCoord = 1.0-gl_MultiTexCoord0.yx; \n"
|
||||
" // Eye-space lighting \n"
|
||||
" vNormalES = gl_NormalMatrix * normal; \n"
|
||||
" \n"
|
||||
" vViewVec = -vec3(gl_ModelViewMatrix * Pos); \n"
|
||||
" \n"
|
||||
" vLightDir = vec3(gl_ModelViewMatrix * gl_LightSource[0].position); \n"
|
||||
" \n"
|
||||
" \n"
|
||||
" \n"
|
||||
" \n"
|
||||
"} \n"
|
||||
;
|
||||
|
||||
std::string speaker_frag =
|
||||
"//uniform vec4 lightDir; \n"
|
||||
"uniform sampler2D Base; \n"
|
||||
" \n"
|
||||
"varying vec2 vTexCoord; \n"
|
||||
"varying vec3 vNormalES; \n"
|
||||
"varying vec3 vViewVec; \n"
|
||||
"varying vec3 vLightDir; \n"
|
||||
" \n"
|
||||
"void main(void) \n"
|
||||
"{ \n"
|
||||
" \n"
|
||||
" vec4 base = texture2D(Base, vTexCoord); \n"
|
||||
" // Make our base texture a little brighter ... \n"
|
||||
" // Yes, you're right, this should be done in photoshop rather \n"
|
||||
" // than in the shader, but I'm too lazy to make a brighter version \n"
|
||||
" // of this texture or even look for a better one. \n"
|
||||
" base = sqrt(base); \n"
|
||||
" \n"
|
||||
" // Make the speaker more glossy in the middle \n"
|
||||
" vec2 l = vTexCoord - 0.5; \n"
|
||||
" float gloss = clamp(1.0 - 6.0 * dot(l, l), 0.0, 1.0); \n"
|
||||
" \n"
|
||||
" vec3 normal = normalize(vNormalES); \n"
|
||||
" // Soft diffuse \n"
|
||||
" vec3 lightDir = normalize(vLightDir); \n"
|
||||
" float diffuse = 0.5 + 0.5 * dot(lightDir, normal); \n"
|
||||
" // Standard Phong specular \n"
|
||||
" float specular = pow(clamp(dot(reflect(-normalize(vViewVec), normal), lightDir.xyz), 0.0, 1.0), 64.0); \n"
|
||||
" \n"
|
||||
" gl_FragColor = 0.8 * diffuse * base + gloss * specular ; \n"
|
||||
" \n"
|
||||
" \n"
|
||||
"} \n"
|
||||
;
|
||||
|
||||
|
||||
|
||||
std::string tx_phong_vert =
|
||||
"uniform vec3 fvEyePosition; \n"
|
||||
" \n"
|
||||
"varying vec2 Texcoord; \n"
|
||||
"varying vec3 ViewDirection; \n"
|
||||
"varying vec3 LightDirection; \n"
|
||||
"varying vec3 Normal; \n"
|
||||
" \n"
|
||||
"void main( void ) \n"
|
||||
"{ \n"
|
||||
" gl_Position = ftransform(); \n"
|
||||
" Texcoord = gl_MultiTexCoord0.xy; \n"
|
||||
" \n"
|
||||
" vec4 fvObjectPosition = gl_ModelViewMatrix * gl_Vertex; \n"
|
||||
" \n"
|
||||
" ViewDirection = fvEyePosition - fvObjectPosition.xyz; \n"
|
||||
" LightDirection = (gl_LightSource[0].position).xyz - fvObjectPosition.xyz; \n"
|
||||
" Normal = gl_NormalMatrix * gl_Normal; \n"
|
||||
" \n"
|
||||
"} \n"
|
||||
;
|
||||
|
||||
std::string tx_phong_frag =
|
||||
"uniform vec4 fvAmbient; \n"
|
||||
"uniform vec4 fvSpecular; \n"
|
||||
"uniform vec4 fvDiffuse; \n"
|
||||
"uniform float fSpecularPower; \n"
|
||||
" \n"
|
||||
"uniform sampler2D baseMap; \n"
|
||||
" \n"
|
||||
"varying vec2 Texcoord; \n"
|
||||
"varying vec3 ViewDirection; \n"
|
||||
"varying vec3 LightDirection; \n"
|
||||
"varying vec3 Normal; \n"
|
||||
" \n"
|
||||
"void main( void ) \n"
|
||||
"{ \n"
|
||||
" vec3 fvLightDirection = normalize( LightDirection ); \n"
|
||||
" vec3 fvNormal = normalize( Normal ); \n"
|
||||
" float fNDotL = dot( fvNormal, fvLightDirection ); \n"
|
||||
" \n"
|
||||
" vec3 fvReflection = normalize( ( ( 2.0 * fvNormal ) * fNDotL ) - fvLightDirection ); \n"
|
||||
" vec3 fvViewDirection = normalize( ViewDirection ); \n"
|
||||
" float fRDotV = max( 0.0, dot( fvReflection, fvViewDirection ) ); \n"
|
||||
" \n"
|
||||
" vec4 fvBaseColor = texture2D( baseMap, Texcoord ); \n"
|
||||
" \n"
|
||||
" \n"
|
||||
" vec4 fvTotalAmbient = gl_LightSource[0].ambient * fvBaseColor; \n"
|
||||
" vec4 fvTotalDiffuse = gl_LightSource[0].diffuse * fNDotL * fvBaseColor; \n"
|
||||
" vec4 fvTotalSpecular = gl_LightSource[0].specular * ( pow( fRDotV, fSpecularPower ) ); \n"
|
||||
" \n"
|
||||
" gl_FragColor = ( fvTotalAmbient + fvTotalDiffuse + fvTotalSpecular ); \n"
|
||||
" \n"
|
||||
"} \n"
|
||||
;
|
||||
|
||||
|
||||
|
||||
// OpenGL Vertex Program 1.1
|
||||
std::string style2_vert =
|
||||
"varying vec3 normal;"
|
||||
"varying vec2 Texcoord;"
|
||||
"void main()"
|
||||
"{"
|
||||
" Texcoord = gl_MultiTexCoord0.xy;"
|
||||
" normal = gl_NormalMatrix * gl_Normal;"
|
||||
" gl_Position = ftransform();"
|
||||
"}";
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// OpenGL Fragment Program 1.1
|
||||
std::string style2_frag =
|
||||
"uniform sampler2D baseMap;"
|
||||
"varying vec3 normal;"
|
||||
"varying vec2 Texcoord;"
|
||||
"void main()"
|
||||
"{"
|
||||
" vec4 fvBaseColor = texture2D( baseMap, Texcoord ); "
|
||||
" float intensity;"
|
||||
" vec4 color;"
|
||||
" vec3 n = normalize(normal);"
|
||||
""
|
||||
" intensity = dot(vec3(gl_LightSource[0].position),n);"
|
||||
""
|
||||
" if (intensity > 0.95)"
|
||||
" color = vec4(1.0,0.5,0.5,1.0);"
|
||||
" else if (intensity > 0.5)"
|
||||
" color = vec4(0.6,0.3,0.3,1.0);"
|
||||
" else if (intensity > 0.25)"
|
||||
" color = vec4(0.4,0.2,0.2,1.0);"
|
||||
" else"
|
||||
" color = vec4(0.2,0.1,0.1,1.0);"
|
||||
" color = color * fvBaseColor; \n"
|
||||
" color = normalize(color); \n"
|
||||
" gl_FragColor = color;"
|
||||
"}";
|
||||
|
||||
|
||||
|
||||
|
||||
// OpenGL Vertex Program 1.1
|
||||
std::string style3_vert =
|
||||
"varying vec3 normal;"
|
||||
"varying vec2 Texcoord;"
|
||||
"void main()"
|
||||
"{"
|
||||
" Texcoord = gl_MultiTexCoord0.xy;"
|
||||
" normal = gl_NormalMatrix * gl_Normal;"
|
||||
" gl_Position = ftransform();"
|
||||
"}";
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// OpenGL Fragment Program 1.1
|
||||
std::string style3_frag =
|
||||
"varying vec3 normal;"
|
||||
"varying vec2 Texcoord;"
|
||||
"void main()"
|
||||
"{"
|
||||
" float intensity;"
|
||||
" vec4 color;"
|
||||
" vec3 n = normalize(normal);"
|
||||
""
|
||||
" intensity = dot(vec3(gl_LightSource[0].position),n);"
|
||||
""
|
||||
" if (intensity > 0.95)"
|
||||
" color = vec4(1.0,0.5,0.5,1.0);"
|
||||
" else if (intensity > 0.5)"
|
||||
" color = vec4(0.6,0.3,0.3,1.0);"
|
||||
" else if (intensity > 0.25)"
|
||||
" color = vec4(0.4,0.2,0.2,1.0);"
|
||||
" else"
|
||||
" color = vec4(0.2,0.1,0.1,1.0);"
|
||||
" gl_FragColor = color;"
|
||||
"}";
|
||||
|
||||
|
||||
|
||||
// OpenGL Vertex Program 1.1
|
||||
std::string style4_vert =
|
||||
"varying vec3 vNormal; \n"
|
||||
"varying vec3 vVertex; \n"
|
||||
" \n"
|
||||
"void main(void) \n"
|
||||
"{ \n"
|
||||
" gl_Position = ftransform(); \n"
|
||||
" gl_TexCoord[0] = gl_MultiTexCoord0; \n"
|
||||
" vVertex = vec3(gl_ModelViewMatrix * gl_Vertex); \n"
|
||||
" vNormal = normalize(gl_NormalMatrix * gl_Normal); \n"
|
||||
"} \n"
|
||||
;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// OpenGL Fragment Program 1.1
|
||||
std::string style4_frag =
|
||||
"varying vec3 vNormal; \n"
|
||||
"varying vec3 vVertex; \n"
|
||||
" \n"
|
||||
"uniform float silhouetteThreshold; \n"
|
||||
"uniform vec4 silhouetteColor; \n"
|
||||
"uniform float enableLighting; \n"
|
||||
" \n"
|
||||
"uniform sampler2D tex; \n"
|
||||
" \n"
|
||||
"void main (void) \n"
|
||||
"{ \n"
|
||||
" \n"
|
||||
"vec4 materialColor = gl_FrontMaterial.diffuse; \n"
|
||||
" \n"
|
||||
" //vec4 silhouetteColor = vec4(1.0, 1.0, 1.0, 1.0); \n"
|
||||
" \n"
|
||||
"vec4 specularColor = gl_FrontMaterial.specular; \n"
|
||||
" if(enableLighting == 0.0) \n"
|
||||
" specularColor = vec4(1.0, 1.0, 1.0, 1.0); \n"
|
||||
" \n"
|
||||
"vec3 eyePos = normalize(-vVertex); \n"
|
||||
"vec3 lightPos = gl_LightSource[0].position.xyz; \n"
|
||||
" \n"
|
||||
"vec3 Normal = vNormal; //normalize(vNormal); \n"
|
||||
"vec3 EyeVert = normalize(eyePos - vVertex); \n"
|
||||
"vec3 LightVert = normalize(lightPos - vVertex); \n"
|
||||
"vec3 EyeLight = normalize(LightVert+EyeVert); \n"
|
||||
"vec4 texture = texture2D(tex,gl_TexCoord[0].st); \n"
|
||||
" \n"
|
||||
" float sil = max(dot(Normal,EyeVert), 0.0); \n"
|
||||
" if( sil < silhouetteThreshold ) \n"
|
||||
" gl_FragColor = silhouetteColor; \n"
|
||||
" else \n"
|
||||
" { \n"
|
||||
" gl_FragColor = materialColor*texture; \n"
|
||||
" \n"
|
||||
" float spec = pow(max(dot(Normal,EyeLight),0.0), 5.0); \n"
|
||||
" if( spec < 0.05 ) \n"
|
||||
" gl_FragColor *= 0.9; \n"
|
||||
" else \n"
|
||||
" gl_FragColor = specularColor*texture; \n"
|
||||
" \n"
|
||||
" float diffuse = max(dot(Normal,LightVert),0.0); \n"
|
||||
" if( diffuse < 0.3 && enableLighting != 0.0 ) \n"
|
||||
" gl_FragColor *=0.8; \n"
|
||||
" \n"
|
||||
" } \n"
|
||||
"} \n"
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // RC_FX_SHADERS_H_INCLUDED
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "rc_joints.h"
|
||||
#include <irrtheora.h>
|
||||
|
||||
|
||||
using namespace irr;
|
||||
|
||||
using namespace core;
|
||||
@@ -2535,6 +2536,17 @@ int rc_createImage(int w, int h, double* pdata)
|
||||
return rc_createImageEx(w, h, pdata, 0, false);
|
||||
}
|
||||
|
||||
void rc_convertToNormalMap(int img_id, double amp)
|
||||
{
|
||||
if(img_id < 0 || img_id >= rc_image.size())
|
||||
return;
|
||||
|
||||
if(!rc_image[img_id].image)
|
||||
return;
|
||||
|
||||
VideoDriver->makeNormalMapTexture(rc_image[img_id].image, amp);
|
||||
}
|
||||
|
||||
|
||||
void rc_getImageBuffer(int img_id, double * pdata)
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#else
|
||||
#include <an8parser.h>
|
||||
#endif
|
||||
#include "CShader.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
@@ -431,8 +432,9 @@ int rc_active_font = -1;
|
||||
bool mobile_active_window_flag = true;
|
||||
|
||||
|
||||
|
||||
//------------ 3D Graphics ----------------//
|
||||
#define MAX_DEFAULT_MATERIALS 24
|
||||
|
||||
struct rc_material_obj
|
||||
{
|
||||
irr::video::SMaterial mat;
|
||||
@@ -440,6 +442,9 @@ struct rc_material_obj
|
||||
bool isReference = false;
|
||||
int refActor = -1;
|
||||
int refMatNum = 0;
|
||||
bool isFX = false;
|
||||
int fxMatType = -1; //FX MATERIAL TYPE (note: will be between FX_MATERIAL_BASE_INDEX and FX_MATERIAL_BASE_INDEX + rc_shader_materials.size())
|
||||
CShader* shader = NULL;
|
||||
};
|
||||
|
||||
irr::core::array<rc_material_obj> rc_material;
|
||||
@@ -472,6 +477,7 @@ irr::core::array<rc_an8_obj> rc_an8;
|
||||
#define RC_NODE_TYPE_BILLBOARD 6
|
||||
#define RC_NODE_TYPE_PARTICLE 7
|
||||
#define RC_NODE_TYPE_STMESH 8
|
||||
#define RC_NODE_TYPE_PROJECTOR 9
|
||||
|
||||
|
||||
#define RC_NODE_SHAPE_TYPE_NONE 0
|
||||
@@ -555,6 +561,13 @@ struct rc_actor_animation_obj
|
||||
irr::u32 frame_swap_time;
|
||||
};
|
||||
|
||||
struct rc_actor_fx_material_obj
|
||||
{
|
||||
bool inUse = false;
|
||||
int material_id = -1; //index in rc_materials
|
||||
int actor_material_index = -1; //index from node->getMaterial()
|
||||
};
|
||||
|
||||
struct rc_scene_node
|
||||
{
|
||||
int node_type = 0;
|
||||
@@ -570,7 +583,8 @@ struct rc_scene_node
|
||||
|
||||
rc_particle_properties_obj particle_properties;
|
||||
|
||||
int material_ref_index = -1;
|
||||
int material_ref_index = -1; //Not currently used for anything
|
||||
irr::core::array<rc_actor_fx_material_obj> actor_fx_materials;
|
||||
|
||||
int current_animation;
|
||||
int num_animation_loops;
|
||||
@@ -1006,4 +1020,10 @@ SDL_Surface* convertTextureToSurface(irr::video::ITexture* itexture)
|
||||
}
|
||||
|
||||
|
||||
std::string rc_getGPUInfo()
|
||||
{
|
||||
std::string gpu_info = (std::string)device->getVideoDriver()->getVendorInfo().c_str();
|
||||
return gpu_info;
|
||||
}
|
||||
|
||||
#endif // RC_GFX_CORE_H_INCLUDED
|
||||
|
||||
@@ -44,6 +44,26 @@ void rc_addSceneSkyDomeEx(int img, Uint32 horiRes, Uint32 vertRes, double txPerc
|
||||
rc_scene_properties.sky = SceneManager->addSkyDomeSceneNode(texture, horiRes, vertRes, txPercentage, spherePercentage, radius);
|
||||
}
|
||||
|
||||
void rc_setSceneShadowColor( Uint32 color )
|
||||
{
|
||||
SceneManager->setShadowColor(irr::video::SColor(color));
|
||||
}
|
||||
|
||||
Uint32 rc_getSceneShadowColor( )
|
||||
{
|
||||
return SceneManager->getShadowColor().color;
|
||||
}
|
||||
|
||||
void rc_setSceneAmbientColor( Uint32 color )
|
||||
{
|
||||
SceneManager->setAmbientLight(irr::video::SColor(color));
|
||||
}
|
||||
|
||||
Uint32 rc_getSceneAmbientColor()
|
||||
{
|
||||
return SceneManager->getAmbientLight().toSColor().color;
|
||||
}
|
||||
|
||||
void rc_removeSceneSky()
|
||||
{
|
||||
if(rc_scene_properties.sky)
|
||||
|
||||
@@ -67,6 +67,10 @@
|
||||
<Unit filename="../../irrBullet/src/irrBulletTriangleMeshShape.cpp" />
|
||||
<Unit filename="../../irrBullet/src/irrBulletWorld.cpp" />
|
||||
<Unit filename="../../irrBullet/src/irrBulletcommon.cpp" />
|
||||
<Unit filename="CShader.cpp" />
|
||||
<Unit filename="CShader.h" />
|
||||
<Unit filename="ProjectiveTextures.cpp" />
|
||||
<Unit filename="ProjectiveTextures.h" />
|
||||
<Unit filename="RealisticWater.cpp" />
|
||||
<Unit filename="RealisticWater.h" />
|
||||
<Unit filename="camera.h" />
|
||||
@@ -83,6 +87,8 @@
|
||||
<Unit filename="rc_defines.h" />
|
||||
<Unit filename="rc_font.h" />
|
||||
<Unit filename="rc_func130_cases.h" />
|
||||
<Unit filename="rc_fx_materials.h" />
|
||||
<Unit filename="rc_fx_shaders.h" />
|
||||
<Unit filename="rc_geometry.h" />
|
||||
<Unit filename="rc_gfx.h" />
|
||||
<Unit filename="rc_gfx3D.h" />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# depslib dependency file v1.0
|
||||
1742479051 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/main.cpp
|
||||
1744343721 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/main.cpp
|
||||
"rc_os_defines.h"
|
||||
<emscripten.h>
|
||||
<sys/param.h>
|
||||
@@ -33,10 +33,10 @@
|
||||
<irrtheora.h>
|
||||
"rc_func130_cases.h"
|
||||
|
||||
1742504995 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_os_defines.h
|
||||
1744343669 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_os_defines.h
|
||||
<TargetConditionals.h>
|
||||
|
||||
1742442075 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_defines.h
|
||||
1744330643 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_defines.h
|
||||
|
||||
1734372966 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_stdlib.h
|
||||
"rc_os_defines.h"
|
||||
@@ -1248,7 +1248,7 @@
|
||||
1734372058 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/RealisticWater.h
|
||||
<irrlicht.h>
|
||||
|
||||
1738504435 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_gfx.h
|
||||
1744257792 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_gfx.h
|
||||
"SDL.h"
|
||||
<SDL2/SDL.h>
|
||||
<irrlicht.h>
|
||||
@@ -1272,7 +1272,7 @@
|
||||
"rc_joints.h"
|
||||
<irrtheora.h>
|
||||
|
||||
1738504435 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_gfx_core.h
|
||||
1744336898 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_gfx_core.h
|
||||
"SDL.h"
|
||||
"btBulletDynamicsCommon.h"
|
||||
"BulletSoftBody/btSoftRigidDynamicsWorld.h"
|
||||
@@ -1297,6 +1297,7 @@
|
||||
<irrBullet.h>
|
||||
"an8parser.h"
|
||||
<an8parser.h>
|
||||
"CShader.h"
|
||||
|
||||
1734372058 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_utf8.h
|
||||
<string>
|
||||
@@ -1306,7 +1307,7 @@
|
||||
<irrlicht.h>
|
||||
<iostream>
|
||||
|
||||
1742434895 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_sprite2D.h
|
||||
1742507800 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_sprite2D.h
|
||||
<irrlicht.h>
|
||||
<box2d/box2d.h>
|
||||
|
||||
@@ -2275,7 +2276,7 @@
|
||||
"rc_gfx_core.h"
|
||||
<irrtheora.h>
|
||||
|
||||
1742442075 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_func130_cases.h
|
||||
1744330643 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_func130_cases.h
|
||||
|
||||
1724469097 source:/home/n00b/Projects/irrBullet/src/irrBullet.cpp
|
||||
"irrBullet.h"
|
||||
@@ -2491,7 +2492,7 @@
|
||||
<cmath>
|
||||
<cstdint>
|
||||
|
||||
1742504452 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_spritelib.h
|
||||
1742507800 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_spritelib.h
|
||||
"SDL.h"
|
||||
<SDL2/SDL.h>
|
||||
"rc_sprite2D.h"
|
||||
@@ -2521,9 +2522,11 @@
|
||||
1734372966 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_physics3D_base.h
|
||||
"rc_gfx_core.h"
|
||||
|
||||
1738504435 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_base_actor.h
|
||||
1744341618 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_base_actor.h
|
||||
"ProjectiveTextures.h"
|
||||
|
||||
1734372966 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_material.h
|
||||
1744333498 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_material.h
|
||||
"rc_fx_materials.h"
|
||||
|
||||
1734372966 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_animation.h
|
||||
|
||||
@@ -2535,12 +2538,12 @@
|
||||
|
||||
1734372058 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_particles.h
|
||||
|
||||
1738504435 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_scene.h
|
||||
1744258575 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_scene.h
|
||||
"rc_gfx_core.h"
|
||||
|
||||
1734372058 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_camera.h
|
||||
|
||||
1738504435 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_windowclose.h
|
||||
1744319969 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_windowclose.h
|
||||
|
||||
1608686973 /usr/include/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
|
||||
"BulletCollision/CollisionShapes/btTriangleCallback.h"
|
||||
@@ -2554,3 +2557,25 @@
|
||||
<vector>
|
||||
<algorithm>
|
||||
|
||||
1744333498 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_fx_materials.h
|
||||
<irrlicht.h>
|
||||
"CShader.h"
|
||||
"rc_fx_shaders.h"
|
||||
|
||||
1744332513 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/CShader.h
|
||||
<irrlicht.h>
|
||||
<string>
|
||||
|
||||
1744322711 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_fx_shaders.h
|
||||
|
||||
1744326520 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/CShader.cpp
|
||||
<irrlicht.h>
|
||||
<iostream>
|
||||
"CShader.h"
|
||||
|
||||
1744345468 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/ProjectiveTextures.h
|
||||
<irrlicht.h>
|
||||
|
||||
1744345176 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/ProjectiveTextures.cpp
|
||||
"ProjectiveTextures.h"
|
||||
|
||||
|
||||
@@ -2,127 +2,9 @@
|
||||
<CodeBlocks_layout_file>
|
||||
<FileVersion major="1" minor="0" />
|
||||
<ActiveTarget name="Debug" />
|
||||
<File name="rc_windowclose.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<File name="rc_joints.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="24178" topLine="335" />
|
||||
</Cursor>
|
||||
<Folding>
|
||||
<Collapse line="157" />
|
||||
</Folding>
|
||||
</File>
|
||||
<File name="rc_matrix.h" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="116" topLine="804" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_actor_animation.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="1461" topLine="42" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="main.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="133462" topLine="4441" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_sprite_physics.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="13990" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="../../irrBullet/src/irrBulletcommon.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="924" topLine="6" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_geometry.h" open="0" top="0" tabpos="20" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="20919" topLine="652" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_scene.h" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="1364" topLine="33" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="../../irrBullet/src/irrBulletRigidBody.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="2046" topLine="42" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_constraint.h" open="0" top="0" tabpos="15" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="8391" topLine="231" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="camera.h" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="640" topLine="13" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="../../irrBullet/src/irrBulletCollisionObject.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="0" topLine="384" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_os_defines.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="91" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_video.h" open="0" top="0" tabpos="21" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="169" topLine="6" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_actor_physics.h" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="0" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_gfx3D.h" open="0" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="565" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_media.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="17752" topLine="630" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_defines.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="190390" topLine="2847" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_tilemap.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="243" topLine="26" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_physics3D_base.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="3283" topLine="66" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_font.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="0" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="RealisticWater.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="7671" topLine="204" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_mesh.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="5389" topLine="242" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_gfx_core.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="22508" topLine="757" />
|
||||
<Cursor1 position="310" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="gui_freetype_font.cpp" open="0" top="0" tabpos="24" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
@@ -130,69 +12,24 @@
|
||||
<Cursor1 position="792" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_test.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<File name="rc_actor_animation.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="115" topLine="0" />
|
||||
<Cursor1 position="6134" topLine="75" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_base_actor.h" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<File name="main.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="27800" topLine="996" />
|
||||
<Cursor1 position="130210" topLine="4303" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_stdlib.h" open="0" top="0" tabpos="18" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<File name="rc_geometry.h" open="0" top="0" tabpos="20" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="24491" topLine="1083" />
|
||||
<Cursor1 position="20919" topLine="652" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_audio.h" open="0" top="0" tabpos="18" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<File name="rc_font.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="6531" topLine="311" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_actor_material.h" open="0" top="0" tabpos="24" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="14123" topLine="456" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_particles.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="6262" topLine="213" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_sprite2D.h" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="111" topLine="3" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="../../irrBullet/src/irrBulletWorld.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="2750" topLine="75" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_joints.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="310" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_tilelib.h" open="0" top="0" tabpos="22" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="3693" topLine="136" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_func130_cases.h" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="79957" topLine="1937" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_gfx.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="4981" topLine="158" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="gui_freetype_font.h" open="0" top="0" tabpos="23" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="183" topLine="0" />
|
||||
<Cursor1 position="0" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_net.h" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
@@ -200,14 +37,200 @@
|
||||
<Cursor1 position="3769" topLine="186" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_stdlib.h" open="0" top="0" tabpos="18" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="24491" topLine="1083" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_spritelib.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="18902" topLine="678" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_video.h" open="0" top="0" tabpos="21" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="169" topLine="6" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="gui_freetype_font.h" open="0" top="0" tabpos="23" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="183" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="../../irrBullet/src/irrBulletCollisionObject.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="0" topLine="384" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_constraint.h" open="0" top="0" tabpos="15" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="8391" topLine="231" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_gfx_core.h" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="1853" topLine="75" />
|
||||
</Cursor>
|
||||
<Folding>
|
||||
<Collapse line="85" />
|
||||
</Folding>
|
||||
</File>
|
||||
<File name="rc_test.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="115" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_windowclose.h" open="1" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="18958" topLine="206" />
|
||||
</Cursor>
|
||||
<Folding>
|
||||
<Collapse line="157" />
|
||||
<Collapse line="492" />
|
||||
<Collapse line="555" />
|
||||
</Folding>
|
||||
</File>
|
||||
<File name="rc_defines.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="190390" topLine="2847" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_gfx3D.h" open="0" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="565" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_os_defines.h" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="91" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_physics3D_base.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="3283" topLine="66" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_audio.h" open="0" top="0" tabpos="18" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="6531" topLine="311" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="CShader.h" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="1197" topLine="46" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="RealisticWater.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="7671" topLine="204" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_matrix.h" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="116" topLine="804" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_particles.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="6262" topLine="615" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_scene.h" open="1" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="1298" topLine="28" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_sprite_physics.h" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="13990" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_sprite2D.h" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="111" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="CShader.cpp" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="1550" topLine="44" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_actor_material.h" open="1" top="1" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="29204" topLine="1010" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_fx_materials.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="7366" topLine="223" />
|
||||
</Cursor>
|
||||
<Folding>
|
||||
<Collapse line="47" />
|
||||
</Folding>
|
||||
</File>
|
||||
<File name="rc_tilemap.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="243" topLine="26" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_func130_cases.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="123127" topLine="2739" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_gfx.h" open="1" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="25187" topLine="1061" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="../../irrBullet/src/irrBulletWorld.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="2750" topLine="75" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="../../irrBullet/src/irrBulletRigidBody.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="2046" topLine="42" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_tilelib.h" open="0" top="0" tabpos="22" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="3693" topLine="136" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="../../irrBullet/src/irrBullet.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="0" topLine="7" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_spritelib.h" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<File name="rc_actor_physics.h" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="15607" topLine="560" />
|
||||
<Cursor1 position="0" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_base_actor.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="41012" topLine="1498" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="../../irrBullet/src/irrBulletcommon.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="924" topLine="6" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_mesh.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="5389" topLine="242" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="rc_media.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="17752" topLine="630" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="camera.h" open="1" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="4654" topLine="100" />
|
||||
</Cursor>
|
||||
</File>
|
||||
</CodeBlocks_layout_file>
|
||||
|
||||
Reference in New Issue
Block a user