Compare commits

...

1 Commits

Author SHA1 Message Date
cabf9b39d8 Load Texture Rework Needed 2024-09-27 17:06:02 +02:00
8 changed files with 122 additions and 16 deletions

View File

@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "windows-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "gcc",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x64",
"compilerArgs": [
""
]
}
],
"version": 4
}

24
enginecustom/.vscode/launch.json vendored Normal file
View File

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

59
enginecustom/.vscode/settings.json vendored Normal file
View File

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

View File

@ -94,6 +94,8 @@ private:
bool RenderRefractionToTexture();
bool RenderReflectionToTexture();
ID3D11ShaderResourceView* LoadTexture(const std::string* filename);
private :
// ------------------------------------- //

View File

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

View File

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

View File

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

View File

@ -221,7 +221,6 @@ void ModelClass::RenderBuffers(ID3D11DeviceContext* deviceContext)
return;
}
bool ModelClass::LoadTextures(ID3D11Device* device, ID3D11DeviceContext* deviceContext, vector<string> 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()