diff --git a/enginecustom/.vscode/c_cpp_properties.json b/enginecustom/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..cea4d3f --- /dev/null +++ b/enginecustom/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "windows-gcc-x64", + "includePath": [ + "${workspaceFolder}/**" + ], + "compilerPath": "gcc", + "cStandard": "${default}", + "cppStandard": "${default}", + "intelliSenseMode": "windows-gcc-x64", + "compilerArgs": [ + "" + ] + } + ], + "version": 4 +} \ No newline at end of file diff --git a/enginecustom/.vscode/launch.json b/enginecustom/.vscode/launch.json new file mode 100644 index 0000000..d0898ec --- /dev/null +++ b/enginecustom/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "C/C++ Runner: Debug Session", + "type": "cppdbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "externalConsole": true, + "cwd": "c:/Users/arivas/Documents/GitHub/khaotic-engine-Reborn/enginecustom", + "program": "c:/Users/arivas/Documents/GitHub/khaotic-engine-Reborn/enginecustom/build/Debug/outDebug", + "MIMode": "gdb", + "miDebuggerPath": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/enginecustom/.vscode/settings.json b/enginecustom/.vscode/settings.json new file mode 100644 index 0000000..bb879da --- /dev/null +++ b/enginecustom/.vscode/settings.json @@ -0,0 +1,59 @@ +{ + "C_Cpp_Runner.cCompilerPath": "gcc", + "C_Cpp_Runner.cppCompilerPath": "g++", + "C_Cpp_Runner.debuggerPath": "gdb", + "C_Cpp_Runner.cStandard": "", + "C_Cpp_Runner.cppStandard": "", + "C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat", + "C_Cpp_Runner.useMsvc": false, + "C_Cpp_Runner.warnings": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wformat=2", + "-Wcast-align", + "-Wconversion", + "-Wsign-conversion", + "-Wnull-dereference" + ], + "C_Cpp_Runner.msvcWarnings": [ + "/W4", + "/permissive-", + "/w14242", + "/w14287", + "/w14296", + "/w14311", + "/w14826", + "/w44062", + "/w44242", + "/w14905", + "/w14906", + "/w14263", + "/w44265", + "/w14928" + ], + "C_Cpp_Runner.enableWarnings": true, + "C_Cpp_Runner.warningsAsError": false, + "C_Cpp_Runner.compilerArgs": [], + "C_Cpp_Runner.linkerArgs": [], + "C_Cpp_Runner.includePaths": [], + "C_Cpp_Runner.includeSearch": [ + "*", + "**/*" + ], + "C_Cpp_Runner.excludeSearch": [ + "**/build", + "**/build/**", + "**/.*", + "**/.*/**", + "**/.vscode", + "**/.vscode/**" + ], + "C_Cpp_Runner.useAddressSanitizer": false, + "C_Cpp_Runner.useUndefinedSanitizer": false, + "C_Cpp_Runner.useLeakSanitizer": false, + "C_Cpp_Runner.showCompilationTime": false, + "C_Cpp_Runner.useLinkTimeOptimization": false, + "C_Cpp_Runner.msvcSecureNoWarnings": false +} \ No newline at end of file diff --git a/enginecustom/applicationclass.h b/enginecustom/applicationclass.h index fccdea5..9ed738d 100644 --- a/enginecustom/applicationclass.h +++ b/enginecustom/applicationclass.h @@ -94,6 +94,8 @@ private: bool RenderRefractionToTexture(); bool RenderReflectionToTexture(); + ID3D11ShaderResourceView* LoadTexture(const std::string* filename); + private : // ------------------------------------- // diff --git a/enginecustom/celshading.ps b/enginecustom/celshading.ps index 32fd479..5d567d3 100644 --- a/enginecustom/celshading.ps +++ b/enginecustom/celshading.ps @@ -83,5 +83,7 @@ float4 CelShadingPixelShader(PixelInputType input) : SV_TARGET // Calculate the final color by combining the texture color with the light intensity and diffuse color. finalColor = textureColor * diffuseColor * lightIntensity; - return finalColor; + //return finalColor; + + return float4(normal * 0.5f + 0.5f, 1.0f); } diff --git a/enginecustom/celshading.vs b/enginecustom/celshading.vs index 842d724..9322f89 100644 --- a/enginecustom/celshading.vs +++ b/enginecustom/celshading.vs @@ -33,7 +33,7 @@ PixelInputType CelShadingVertexShader(VertexInputType input) output.position = mul(output.position, projectionMatrix); // Pass the normal to the pixel shader - output.normal = mul((float3x3)worldMatrix, input.normal); + output.normal = normalize(mul((float3x3) worldMatrix, input.normal)); // Pass the world position to the pixel shader output.worldPos = worldPosition.xyz; diff --git a/enginecustom/imgui.ini b/enginecustom/imgui.ini index 45d976f..8dc75f1 100644 --- a/enginecustom/imgui.ini +++ b/enginecustom/imgui.ini @@ -3,22 +3,22 @@ Pos=60,60 Size=400,400 [Window][Khaotic Engine] -Pos=509,25 -Size=392,273 - -[Window][Objects] -Pos=934,36 -Size=457,294 +Pos=506,44 +Size=339,252 [Window][Terrain] -Pos=60,60 -Size=342,82 +Pos=185,62 +Size=320,75 [Window][Light] -Pos=1564,17 -Size=345,519 +Pos=1111,62 +Size=354,190 [Window][Shader Manager] -Pos=32,253 -Size=172,284 +Pos=39,177 +Size=165,54 + +[Window][Objects] +Pos=1450,122 +Size=388,116 diff --git a/enginecustom/modelclass.cpp b/enginecustom/modelclass.cpp index 55ace1b..d092794 100644 --- a/enginecustom/modelclass.cpp +++ b/enginecustom/modelclass.cpp @@ -221,7 +221,6 @@ void ModelClass::RenderBuffers(ID3D11DeviceContext* deviceContext) return; } - bool ModelClass::LoadTextures(ID3D11Device* device, ID3D11DeviceContext* deviceContext, vector textureFile) { Logger::Get().Log("Loading textures", __FILE__, __LINE__); @@ -243,7 +242,9 @@ bool ModelClass::LoadTextures(ID3D11Device* device, ID3D11DeviceContext* deviceC Logger::Get().Log("Textures loaded", __FILE__, __LINE__); - return true; + + // return the texture object array. + return m_Textures; } void ModelClass::ReleaseTextures()