From ee5395bd667d389aaf55128e81923fc8667cba65 Mon Sep 17 00:00:00 2001 From: n00b87 Date: Fri, 22 Aug 2025 15:25:07 -0500 Subject: [PATCH] WIP --- doc/doc_files/getactormaterialtype.html | 35 +- doc/doc_files/getmaterialantialiasing.html | 14 +- doc/doc_files/getmaterialconstant.html | 3 + doc/doc_files/getmaterialtype.html | 35 +- doc/doc_files/serenity_api_meshes.html | 11 + doc/doc_files/setactormaterialtype.html | 35 +- doc/doc_files/setmaterialantialiasing.html | 14 +- doc/doc_files/setmaterialconstant.html | 180 +++++++++ doc/doc_files/setmaterialtype.html | 35 +- doc/files/getmaterialconstant.txt | 2 + doc/files/setmaterialconstant.txt | 111 ++++++ doc/serenity_docs/serenity_api_meshes.html | 11 + doc/serenity_docs/serenity_api_meshes.txt | 6 + doc/serenity_docs/update_doc.sh | 0 rcbasic_build/rcbasic_build.layout | 94 ++--- rcbasic_runtime/CShader.cpp | 4 +- rcbasic_runtime/main.cpp | 6 +- rcbasic_runtime/rc_actor_material.h | 1 + rcbasic_runtime/rc_fx_materials.h | 35 +- rcbasic_runtime/rc_os_defines.h | 2 +- rcbasic_runtime/rcbasic_runtime.depend | 10 +- rcbasic_runtime/rcbasic_runtime.layout | 404 ++++++++++----------- 22 files changed, 767 insertions(+), 281 deletions(-) mode change 100644 => 100755 doc/serenity_docs/update_doc.sh diff --git a/doc/doc_files/getactormaterialtype.html b/doc/doc_files/getactormaterialtype.html index ae96d78..1f4aaf2 100644 --- a/doc/doc_files/getactormaterialtype.html +++ b/doc/doc_files/getactormaterialtype.html @@ -88,7 +88,40 @@ MATERIAL_TYPE_ONETEXTURE_BLEND 
  • - MATERIAL_TYPE_FORCE_32BIT  + FX_MATERIAL_TYPE_NORMAL_BLEND +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION2 +
  • +
  • + FX_MATERIAL_TYPE_GOOCH +
  • +
  • + FX_MATERIAL_TYPE_PLASTIC +
  • +
  • + FX_MATERIAL_TYPE_TANGENT +
  • +
  • + FX_MATERIAL_TYPE_SPEAKER +
  • +
  • + FX_MATERIAL_TYPE_PHONG_TEXTURE +
  • +
  • + FX_MATERIAL_TYPE_STYLE +
  • +
  • + FX_MATERIAL_TYPE_STYLE2 +
  • +
  • + FX_MATERIAL_TYPE_STYLE3 +
  • +
  • + FX_MATERIAL_TYPE_STYLE4

  • Related: diff --git a/doc/doc_files/getmaterialantialiasing.html b/doc/doc_files/getmaterialantialiasing.html index 25a6797..91bd19d 100644 --- a/doc/doc_files/getmaterialantialiasing.html +++ b/doc/doc_files/getmaterialantialiasing.html @@ -16,25 +16,25 @@


    Related: diff --git a/doc/doc_files/getmaterialconstant.html b/doc/doc_files/getmaterialconstant.html index 8a8120c..544eb65 100644 --- a/doc/doc_files/getmaterialconstant.html +++ b/doc/doc_files/getmaterialconstant.html @@ -11,6 +11,9 @@

    Gets the constant value of an FX material

    +

    + NOTE: To see a list of constants for each material type, reference SetMaterialConstant() +


    Related: SetMaterialConstant

    diff --git a/doc/doc_files/getmaterialtype.html b/doc/doc_files/getmaterialtype.html index b040404..cbba247 100644 --- a/doc/doc_files/getmaterialtype.html +++ b/doc/doc_files/getmaterialtype.html @@ -88,7 +88,40 @@ MATERIAL_TYPE_ONETEXTURE_BLEND 
  • - MATERIAL_TYPE_FORCE_32BIT  + FX_MATERIAL_TYPE_NORMAL_BLEND +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION2 +
  • +
  • + FX_MATERIAL_TYPE_GOOCH +
  • +
  • + FX_MATERIAL_TYPE_PLASTIC +
  • +
  • + FX_MATERIAL_TYPE_TANGENT +
  • +
  • + FX_MATERIAL_TYPE_SPEAKER +
  • +
  • + FX_MATERIAL_TYPE_PHONG_TEXTURE +
  • +
  • + FX_MATERIAL_TYPE_STYLE +
  • +
  • + FX_MATERIAL_TYPE_STYLE2 +
  • +
  • + FX_MATERIAL_TYPE_STYLE3 +
  • +
  • + FX_MATERIAL_TYPE_STYLE4

  • Related: diff --git a/doc/doc_files/serenity_api_meshes.html b/doc/doc_files/serenity_api_meshes.html index e3a2862..49dd75b 100644 --- a/doc/doc_files/serenity_api_meshes.html +++ b/doc/doc_files/serenity_api_meshes.html @@ -185,6 +185,17 @@

    + Function Serenity_GetMeshAnimationIDByName(mesh_index, animation_name$) +

    + +

    +
    +

    +

    \ No newline at end of file diff --git a/doc/doc_files/setactormaterialtype.html b/doc/doc_files/setactormaterialtype.html index d0d5809..533e71f 100644 --- a/doc/doc_files/setactormaterialtype.html +++ b/doc/doc_files/setactormaterialtype.html @@ -91,7 +91,40 @@ MATERIAL_TYPE_ONETEXTURE_BLEND 

  • - MATERIAL_TYPE_FORCE_32BIT  + FX_MATERIAL_TYPE_NORMAL_BLEND +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION2 +
  • +
  • + FX_MATERIAL_TYPE_GOOCH +
  • +
  • + FX_MATERIAL_TYPE_PLASTIC +
  • +
  • + FX_MATERIAL_TYPE_TANGENT +
  • +
  • + FX_MATERIAL_TYPE_SPEAKER +
  • +
  • + FX_MATERIAL_TYPE_PHONG_TEXTURE +
  • +
  • + FX_MATERIAL_TYPE_STYLE +
  • +
  • + FX_MATERIAL_TYPE_STYLE2 +
  • +
  • + FX_MATERIAL_TYPE_STYLE3 +
  • +
  • + FX_MATERIAL_TYPE_STYLE4

  • Related: diff --git a/doc/doc_files/setmaterialantialiasing.html b/doc/doc_files/setmaterialantialiasing.html index b8a2218..c0dd5e8 100644 --- a/doc/doc_files/setmaterialantialiasing.html +++ b/doc/doc_files/setmaterialantialiasing.html @@ -16,25 +16,25 @@


    Related: diff --git a/doc/doc_files/setmaterialconstant.html b/doc/doc_files/setmaterialconstant.html index 5e01075..1d73ecd 100644 --- a/doc/doc_files/setmaterialconstant.html +++ b/doc/doc_files/setmaterialconstant.html @@ -11,6 +11,186 @@

    Sets the constant value of an FX material

    +

    + NOTE: Each constant can ve of type Float, Vec2, Vec3, or Vec4. The ones listed as defined are set internally by the runtime. +

    +

    + FX_MATERIAL_TYPE_NORMAL_BLEND Possible Constants +

    + +

    + FX_MATERIAL_TYPE_REFRACTION Possible Constants +

    + +

    + FX_MATERIAL_TYPE_REFRACTION2 Possible Constants +

    + +

    + FX_MATERIAL_TYPE_GOOCH Possible Constants +

    + +

    + FX_MATERIAL_TYPE_PLASTIC Possible Constants +

    + +

    + FX_MATERIAL_TYPE_TANGENT Possible Constants +

    + +

    + FX_MATERIAL_TYPE_SPEAKER Possible Constants +

    + +

    + FX_MATERIAL_TYPE_PHONG_TEXTURE Possible Constants +

    + +

    + FX_MATERIAL_TYPE_STYLE Possible Constants +

    + +

    + FX_MATERIAL_TYPE_STYLE2 Possible Constants +

    + +

    + FX_MATERIAL_TYPE_STYLE3 Possible Constants +

    + +

    + FX_MATERIAL_TYPE_STYLE4 Possible Constants +

    +

    Related: GetMaterialConstant

    diff --git a/doc/doc_files/setmaterialtype.html b/doc/doc_files/setmaterialtype.html index 5029ffa..9fe2b62 100644 --- a/doc/doc_files/setmaterialtype.html +++ b/doc/doc_files/setmaterialtype.html @@ -88,7 +88,40 @@ MATERIAL_TYPE_ONETEXTURE_BLEND 
  • - MATERIAL_TYPE_FORCE_32BIT  + FX_MATERIAL_TYPE_NORMAL_BLEND +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION +
  • +
  • + FX_MATERIAL_TYPE_REFRACTION2 +
  • +
  • + FX_MATERIAL_TYPE_GOOCH +
  • +
  • + FX_MATERIAL_TYPE_PLASTIC +
  • +
  • + FX_MATERIAL_TYPE_TANGENT +
  • +
  • + FX_MATERIAL_TYPE_SPEAKER +
  • +
  • + FX_MATERIAL_TYPE_PHONG_TEXTURE +
  • +
  • + FX_MATERIAL_TYPE_STYLE +
  • +
  • + FX_MATERIAL_TYPE_STYLE2 +
  • +
  • + FX_MATERIAL_TYPE_STYLE3 +
  • +
  • + FX_MATERIAL_TYPE_STYLE4

  • Related: diff --git a/doc/files/getmaterialconstant.txt b/doc/files/getmaterialconstant.txt index d78ef3b..6ac4940 100644 --- a/doc/files/getmaterialconstant.txt +++ b/doc/files/getmaterialconstant.txt @@ -3,4 +3,6 @@ Gets the constant value of an FX material +NOTE: To see a list of constants for each material type, reference SetMaterialConstant() + #ref SetMaterialConstant diff --git a/doc/files/setmaterialconstant.txt b/doc/files/setmaterialconstant.txt index b7da217..47b3c28 100644 --- a/doc/files/setmaterialconstant.txt +++ b/doc/files/setmaterialconstant.txt @@ -3,4 +3,115 @@ Sets the constant value of an FX material + +NOTE: Each constant can ve of type Float, Vec2, Vec3, or Vec4. The ones listed as defined are set internally by the runtime. + +FX_MATERIAL_TYPE_NORMAL_BLEND +Possible Constants +#list ul +#li [Float] Alpha +#/list + + +FX_MATERIAL_TYPE_REFRACTION +Possible Constants +#list ul +#li [Vec3] BaseColor +#li [Float] Depth +#li [Float] MixRatio +#li [Float] FrameWidth +#li [Float] FrameHeight +#li [-Defined-] EnvMap +#li [-Defined-] RefractionMap +#/list + + +FX_MATERIAL_TYPE_REFRACTION2 +Possible Constants +#list ul +#li NONE +#/list + +FX_MATERIAL_TYPE_GOOCH +Possible Constants +#list ul +#li [Vec3] SurfaceColor +#li [Vec3] WarmColor +#li [Vec3] CoolColor +#li [Float] DiffuseWarm +#li [Float] DiffuseCool +#/list + +FX_MATERIAL_TYPE_PLASTIC +Possible Constants +#list ul +#li [Vec4] Color +#li [Float] Intensity +#/list + + +FX_MATERIAL_TYPE_TANGENT +Possible Constants +#list ul +#li [Float] BViewSpace +#li [Defined] MatView +#/list + + +FX_MATERIAL_TYPE_SPEAKER +Possible Constants +#list ul +#li [Float] PulseSharpness +#li [Float] Beat +#li [Float] Amplitude +#li [Float] BassFrequency +#li [Defined] Base +#li [Defined] View_Proj_Matrix +#li [Defined] View_Matrix +#li [Defined] Time_0_X +#/list + + +FX_MATERIAL_TYPE_PHONG_TEXTURE +Possible Constants +#list ul +#li [Vec4] fvAmbient +#li [Vec4] fvSpecular +#li [Vec4] fvDiffuse +#li [Float] fSpecularPower +#li [-Defined-] BaseMap +#li [-Defined-] fvEyePosition +#/list + + +FX_MATERIAL_TYPE_STYLE +Possible Constants +#list ul +#li [-Defined-] LightPos +#/list + + +FX_MATERIAL_TYPE_STYLE2 +Possible Constants +#list ul +#li [-Defined-] BaseMap +#/list + + +FX_MATERIAL_TYPE_STYLE3 +Possible Constants +#list ul +#li NONE +#/list + +FX_MATERIAL_TYPE_STYLE4 +Possible Constants +#list ul +#li [Float] SilhouetteThreshold +#li [Vec4] SilhouetteColor +#li [Float] EnableLighting +#li [-Defined-] Tex +#/list + + #ref GetMaterialConstant diff --git a/doc/serenity_docs/serenity_api_meshes.html b/doc/serenity_docs/serenity_api_meshes.html index e3a2862..49dd75b 100644 --- a/doc/serenity_docs/serenity_api_meshes.html +++ b/doc/serenity_docs/serenity_api_meshes.html @@ -185,6 +185,17 @@

    + Function Serenity_GetMeshAnimationIDByName(mesh_index, animation_name$) +

    + +

    +
    +

    +

    \ No newline at end of file diff --git a/doc/serenity_docs/serenity_api_meshes.txt b/doc/serenity_docs/serenity_api_meshes.txt index 4e07024..20560a4 100644 --- a/doc/serenity_docs/serenity_api_meshes.txt +++ b/doc/serenity_docs/serenity_api_meshes.txt @@ -95,3 +95,9 @@ #li Returns the RCBasic mesh animation id #/list
    + +Function Serenity_GetMeshAnimationIDByName(mesh_index, animation_name$) +#list ul +#li Returns the RCBasic mesh animation id +#/list +
    diff --git a/doc/serenity_docs/update_doc.sh b/doc/serenity_docs/update_doc.sh old mode 100644 new mode 100755 diff --git a/rcbasic_build/rcbasic_build.layout b/rcbasic_build/rcbasic_build.layout index c73737d..bd41c27 100755 --- a/rcbasic_build/rcbasic_build.layout +++ b/rcbasic_build/rcbasic_build.layout @@ -2,52 +2,9 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -55,9 +12,52 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rcbasic_runtime/CShader.cpp b/rcbasic_runtime/CShader.cpp index 2d0d2f9..087c7fa 100755 --- a/rcbasic_runtime/CShader.cpp +++ b/rcbasic_runtime/CShader.cpp @@ -52,7 +52,7 @@ CShader::CShader(IrrlichtDevice* device, rc_shader_material_obj shader_material) if(gpu) { - //std::cout << "Compiling Shader" << std::endl; + 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( @@ -60,7 +60,7 @@ CShader::CShader(IrrlichtDevice* device, rc_shader_material_obj shader_material) shader_material.frag_shader.c_str(), "pixelMain", video::EPST_PS_4_1, this, video::EMT_SOLID); - //std::cout << "Result: " << p_material << std::endl; + std::cout << "Result: " << p_material << std::endl; } diff --git a/rcbasic_runtime/main.cpp b/rcbasic_runtime/main.cpp index 8cc4b89..220ec5d 100755 --- a/rcbasic_runtime/main.cpp +++ b/rcbasic_runtime/main.cpp @@ -4452,15 +4452,15 @@ int main(int argc, char * argv[]) //ogles2 test #ifdef RC_TESTING - //rc_intern_dirChange("/home/n00b/test/SpriteShapeTest"); + rc_intern_dirChange("/home/n00b/Desktop/tutorial/sn_video_tutorial/SN_Tutorial"); //rc_intern_dirChange(""); rc_filename = "main.cbc"; //rc_intern_dirChange("/home/n00b/Pictures/UNTITLED"); //rc_filename = "nv_test.cbc"; - rc_intern_dirChange("/home/n00b/Experimental/android-project/app/src/main/assets"); - rc_filename = "main.cbc"; + //rc_intern_dirChange("/home/n00b/Experimental/android-project/app/src/main/assets"); + //rc_filename = "main.cbc"; #endif //--------------- diff --git a/rcbasic_runtime/rc_actor_material.h b/rcbasic_runtime/rc_actor_material.h index c84370f..8d925f7 100755 --- a/rcbasic_runtime/rc_actor_material.h +++ b/rcbasic_runtime/rc_actor_material.h @@ -236,6 +236,7 @@ void rc_setActorMaterial(int actor, int material_num, int material_id) { if(rc_material[material_id].shader) { + rc_actor[actor].mesh_node->getMaterial(material_num) = rc_material[material_id].mat; 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); diff --git a/rcbasic_runtime/rc_fx_materials.h b/rcbasic_runtime/rc_fx_materials.h index c1fb5d2..b48a551 100755 --- a/rcbasic_runtime/rc_fx_materials.h +++ b/rcbasic_runtime/rc_fx_materials.h @@ -665,8 +665,6 @@ void rc_setMaterialConstant(int material_id, std::string m_constant, double n1, if(!rc_material[material_id].isFX) return; - float m_constant_value[] = {n1, n2, n3, n4}; - m_constant = rc_intern_trim(rc_intern_lcase(m_constant)); for(int i = 0; i < rc_material[material_id].shader->getUniformVariableCount(); i++) @@ -675,7 +673,38 @@ void rc_setMaterialConstant(int material_id, std::string m_constant, double n1, u_var = rc_intern_trim(rc_intern_lcase(u_var)); if(u_var.compare(m_constant)==0) { - rc_material[material_id].shader->getUniformVariable(i)->value = m_constant_value; + switch(rc_material[material_id].shader->getUniformVariable(i)->type) + { + case ESVT_FLOAT: + { + rc_material[material_id].shader->getUniformVariable(i)->value[0] = n1; + } + break; + + case ESVT_VEC2: + { + rc_material[material_id].shader->getUniformVariable(i)->value[0] = n1; + rc_material[material_id].shader->getUniformVariable(i)->value[1] = n2; + } + break; + + case ESVT_VEC3: + { + rc_material[material_id].shader->getUniformVariable(i)->value[0] = n1; + rc_material[material_id].shader->getUniformVariable(i)->value[1] = n2; + rc_material[material_id].shader->getUniformVariable(i)->value[2] = n3; + } + break; + + case ESVT_VEC4: + { + rc_material[material_id].shader->getUniformVariable(i)->value[0] = n1; + rc_material[material_id].shader->getUniformVariable(i)->value[1] = n2; + rc_material[material_id].shader->getUniformVariable(i)->value[2] = n3; + rc_material[material_id].shader->getUniformVariable(i)->value[3] = n4; + } + break; + } break; } } diff --git a/rcbasic_runtime/rc_os_defines.h b/rcbasic_runtime/rc_os_defines.h index eae86e7..985f46f 100755 --- a/rcbasic_runtime/rc_os_defines.h +++ b/rcbasic_runtime/rc_os_defines.h @@ -2,7 +2,7 @@ #define RC_OS_DEFINES_H_INCLUDED //USED FOR TESTING ONLY -//#define RC_TESTING +#define RC_TESTING //I am checking Android first since I think it also defines __linux__ diff --git a/rcbasic_runtime/rcbasic_runtime.depend b/rcbasic_runtime/rcbasic_runtime.depend index 4c13ba6..43715ad 100755 --- a/rcbasic_runtime/rcbasic_runtime.depend +++ b/rcbasic_runtime/rcbasic_runtime.depend @@ -1,5 +1,5 @@ # depslib dependency file v1.0 -1754545071 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/main.cpp +1755890851 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/main.cpp "rc_os_defines.h" @@ -33,7 +33,7 @@ "rc_func130_cases.h" -1753538775 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_os_defines.h +1755890765 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_os_defines.h 1754605794 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_defines.h @@ -2527,7 +2527,7 @@ 1752028340 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_base_actor.h "ProjectiveTextures.h" -1752028340 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_material.h +1755894050 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_material.h "rc_fx_materials.h" 1752028340 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_animation.h @@ -2559,7 +2559,7 @@ -1755137987 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_fx_materials.h +1755890976 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_fx_materials.h "CShader.h" "rc_fx_shaders.h" @@ -2571,7 +2571,7 @@ 1752028340 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_fx_shaders.h -1748042868 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/CShader.cpp +1755893833 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/CShader.cpp "CShader.h" diff --git a/rcbasic_runtime/rcbasic_runtime.layout b/rcbasic_runtime/rcbasic_runtime.layout index 09883fd..f964fa1 100755 --- a/rcbasic_runtime/rcbasic_runtime.layout +++ b/rcbasic_runtime/rcbasic_runtime.layout @@ -2,24 +2,9 @@ - + - - - - - - - - - - - - - - - - + @@ -27,134 +12,9 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -162,19 +22,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + + + + + + + + + + + + + + + + + + + + + @@ -187,74 +102,94 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -262,4 +197,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +