FX materials can now use material properties before and after type is set

This commit is contained in:
n00b87
2025-08-22 21:19:23 -05:00
parent ee5395bd66
commit ab9238cdb8
4 changed files with 164 additions and 161 deletions

View File

@@ -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;
}

View File

@@ -28,7 +28,10 @@ bool createShaderMaterial(int material_id, int fx_material_type)
//std::cout << "Shader Index = " << shader_index << std::endl;
rc_material[material_id].shader = new CShader(device, rc_shader_materials[shader_index]);
rc_material[material_id].shader = NULL;
if(device)
rc_material[material_id].shader = new CShader(device, rc_shader_materials[shader_index]);
if(rc_material[material_id].shader)
{

View File

@@ -2527,7 +2527,7 @@
1752028340 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_base_actor.h
"ProjectiveTextures.h"
1755894050 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_actor_material.h
1755897401 /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
@@ -2571,7 +2571,7 @@
1752028340 /home/n00b/Projects/RCBASIC4/rcbasic_runtime/rc_fx_shaders.h
1755893833 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/CShader.cpp
1755897318 source:/home/n00b/Projects/RCBASIC4/rcbasic_runtime/CShader.cpp
<irrlicht.h>
<iostream>
"CShader.h"

View File

@@ -2,69 +2,14 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
<File name="../../irrBullet/src/irrBulletRigidBody.cpp" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2248" topLine="493" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletGhostObject.cpp" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1861" topLine="27" />
</Cursor>
</File>
<File name="rc_windowclose.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="23822" topLine="643" />
</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="ProjectiveTextures.h" open="0" top="0" tabpos="34" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="110" topLine="0" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletCollisionObject.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="322" topLine="4" />
</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_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="CShader.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<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="2132" topLine="96" />
</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="rc_actor_material.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="850" topLine="12" />
</Cursor>
</File>
<File name="rc_actor_animation.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="9592" topLine="289" />
</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">
<Cursor>
<Cursor1 position="115" topLine="0" />
<Cursor1 position="169" topLine="6" />
</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">
@@ -72,34 +17,49 @@
<Cursor1 position="924" topLine="6" />
</Cursor>
</File>
<File name="rc_sprite_physics.h" open="0" top="0" tabpos="38" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="../../irrBullet/src/irrBulletRigidBody.cpp" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="16031" topLine="523" />
<Cursor1 position="2248" topLine="493" />
</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">
<File name="rc_actor_material.h" open="1" top="0" tabpos="20" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="3283" topLine="66" />
<Cursor1 position="751" topLine="1317" />
</Cursor>
</File>
<File name="rc_stdlib.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="gui_freetype_font.cpp" open="0" top="0" tabpos="24" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1212" topLine="51" />
<Cursor1 position="792" topLine="0" />
</Cursor>
</File>
<File name="ProjectiveTextures.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="main.cpp" open="1" top="0" tabpos="23" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="348" topLine="166" />
<Cursor1 position="130086" topLine="4447" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletCollisionCallBackInformation.cpp" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="CShader.h" open="1" top="0" tabpos="21" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1253" topLine="0" />
<Cursor1 position="1204" topLine="34" />
</Cursor>
</File>
<File name="rc_func130_cases.h" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="rc_matrix.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="84330" topLine="2045" />
<Cursor1 position="34977" topLine="1288" />
</Cursor>
</File>
<File name="rc_os_defines.h" open="1" top="0" tabpos="25" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="91" topLine="0" />
</Cursor>
</File>
<File name="rc_gfx_core.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="23585" topLine="785" />
</Cursor>
</File>
<File name="rc_actor_animation.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="9592" topLine="289" />
</Cursor>
</File>
<File name="rc_mesh.h" open="0" top="0" tabpos="16" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@@ -107,14 +67,59 @@
<Cursor1 position="1830" topLine="71" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletSoftBody.cpp" open="0" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="rc_fx_materials.h" open="1" top="0" tabpos="18" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="885" topLine="2" />
<Cursor1 position="921" topLine="589" />
</Cursor>
</File>
<File name="rc_gfx_core.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="rc_spritelib.h" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="23585" topLine="785" />
<Cursor1 position="47918" topLine="1604" />
</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="rc_scene.h" open="0" top="0" tabpos="30" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1298" topLine="28" />
</Cursor>
</File>
<File name="rc_steam_lib.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1942" topLine="71" />
</Cursor>
</File>
<File name="rc_stdlib.h" open="1" top="0" tabpos="24" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1212" topLine="51" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletCollisionCallBackInformation.cpp" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1253" topLine="0" />
</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_media.h" open="0" top="0" tabpos="17" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="72119" topLine="1937" />
</Cursor>
</File>
<File name="rc_base_actor.h" open="1" top="0" tabpos="27" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="37687" topLine="1366" />
</Cursor>
</File>
<File name="rc_fx_shaders.h" open="1" top="0" tabpos="19" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="178" topLine="772" />
</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">
@@ -127,59 +132,14 @@
<Cursor1 position="8391" topLine="231" />
</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_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_media.h" open="0" top="0" tabpos="17" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="72119" topLine="1937" />
</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_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="rc_steam_lib.h" open="0" top="0" tabpos="12" 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="1942" topLine="71" />
</Cursor>
</File>
<File name="rc_fx_shaders.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="178" topLine="775" />
</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="camera.h" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="4758" topLine="241" />
</Cursor>
</File>
<File name="main.cpp" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="130086" topLine="4447" />
</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" />
<Cursor1 position="310" 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">
@@ -187,34 +147,29 @@
<Cursor1 position="3769" topLine="186" />
</Cursor>
</File>
<File name="rc_steam.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<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="854" topLine="0" />
<Cursor1 position="6262" topLine="615" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletWorld.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="rc_func130_cases.h" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="18445" topLine="18" />
<Cursor1 position="84330" topLine="2045" />
</Cursor>
</File>
<File name="rc_os_defines.h" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="rc_gfx.h" open="1" top="1" tabpos="26" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="91" topLine="0" />
<Cursor1 position="41480" topLine="234" />
</Cursor>
</File>
<File name="rc_base_actor.h" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="ProjectiveTextures.h" open="0" top="0" tabpos="34" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="20648" topLine="1098" />
<Cursor1 position="110" topLine="0" />
</Cursor>
</File>
<File name="rc_spritelib.h" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<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="47918" topLine="1604" />
</Cursor>
</File>
<File name="rc_scene.h" open="0" top="0" tabpos="30" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1298" topLine="28" />
<Cursor1 position="565" topLine="0" />
</Cursor>
</File>
<File name="rc_sprite2D.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@@ -222,44 +177,89 @@
<Cursor1 position="558" topLine="13" />
</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">
<Cursor>
<Cursor1 position="115" topLine="0" />
</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="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_steam.cpp" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1410" topLine="0" />
</Cursor>
</File>
<File name="rc_fx_materials.h" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="15139" topLine="608" />
</Cursor>
</File>
<File name="CShader.cpp" open="1" top="1" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="949" topLine="34" />
</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_tilelib.h" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="6694" topLine="319" />
</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">
<File name="camera.h" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="792" topLine="0" />
<Cursor1 position="4758" topLine="241" />
</Cursor>
</File>
<File name="rc_gfx.h" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="../../irrBullet/src/irrBulletWorld.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="41480" topLine="234" />
<Cursor1 position="18445" topLine="18" />
</Cursor>
</File>
<File name="rc_matrix.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<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="34977" topLine="1288" />
<Cursor1 position="0" topLine="7" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletCollisionObject.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="322" topLine="4" />
</Cursor>
</File>
<File name="rc_windowclose.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="23822" topLine="643" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletGhostObject.cpp" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1861" topLine="27" />
</Cursor>
</File>
<File name="CShader.cpp" open="1" top="0" tabpos="22" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1032" topLine="31" />
</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_sprite_physics.h" open="0" top="0" tabpos="38" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="16031" topLine="523" />
</Cursor>
</File>
<File name="rc_steam.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="854" topLine="0" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletSoftBody.cpp" open="0" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="885" topLine="2" />
</Cursor>
</File>
<File name="ProjectiveTextures.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="348" topLine="166" />
</Cursor>
</File>
</CodeBlocks_layout_file>