Dodano swiatlo otoczenia dla monet

This commit is contained in:
s473595 2024-02-29 09:09:11 +01:00
parent 612f160429
commit de08ea9744
18 changed files with 80 additions and 66 deletions

Binary file not shown.

Binary file not shown.

View File

@ -2,10 +2,6 @@
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\maksg\\Documents\\Grafika_2024\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\src\\ex_7_1.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\src\\ex_7_1.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_coin.vert||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\shaders\\shader_coin.vert||{8B382828-6202-11D1-8870-0000F87579D2}"
@ -14,13 +10,17 @@
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_coin.frag||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\shaders\\shader_coin.frag||{8B382828-6202-11D1-8870-0000F87579D2}"
},
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\src\\ex_7_1.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\src\\ex_7_1.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.frag||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\shaders\\shader_5_1_tex_copy.frag||{8B382828-6202-11D1-8870-0000F87579D2}"
},
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\src\\main.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\src\\main.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.vert||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\shaders\\shader_5_1_tex_copy.vert||{8B382828-6202-11D1-8870-0000F87579D2}"
}
],
"DocumentGroupContainers": [
@ -30,12 +30,64 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 4,
"SelectedChildIndex": 2,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "shader_coin.frag",
"DocumentMoniker": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_coin.frag",
"RelativeDocumentMoniker": "projekt_grk\\shaders\\shader_coin.frag",
"ToolTip": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_coin.frag",
"RelativeToolTip": "projekt_grk\\shaders\\shader_coin.frag",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-02-29T07:55:43.769Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "shader_coin.vert",
"DocumentMoniker": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_coin.vert",
"RelativeDocumentMoniker": "projekt_grk\\shaders\\shader_coin.vert",
"ToolTip": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_coin.vert",
"RelativeToolTip": "projekt_grk\\shaders\\shader_coin.vert",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAMAAAAqAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-02-29T07:54:35.741Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "shader_5_1_tex_copy.vert",
"DocumentMoniker": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.vert",
"RelativeDocumentMoniker": "projekt_grk\\shaders\\shader_5_1_tex_copy.vert",
"ToolTip": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.vert",
"RelativeToolTip": "projekt_grk\\shaders\\shader_5_1_tex_copy.vert",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-02-29T07:51:18.227Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "ex_7_1.hpp",
"DocumentMoniker": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\src\\ex_7_1.hpp",
"RelativeDocumentMoniker": "projekt_grk\\src\\ex_7_1.hpp",
"ToolTip": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\src\\ex_7_1.hpp",
"RelativeToolTip": "projekt_grk\\src\\ex_7_1.hpp",
"ViewState": "AQIAAIkAAAAAAAAAAAAmwJYAAAA+AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-02-25T17:55:58.673Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
@ -46,56 +98,8 @@
"RelativeToolTip": "projekt_grk\\shaders\\shader_5_1_tex_copy.frag",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-02-28T08:58:43.519Z"
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "shader_coin.frag",
"DocumentMoniker": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_coin.frag",
"RelativeDocumentMoniker": "projekt_grk\\shaders\\shader_coin.frag",
"ToolTip": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_coin.frag",
"RelativeToolTip": "projekt_grk\\shaders\\shader_coin.frag",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAkAAAAbAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-02-26T19:01:49.259Z"
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "shader_coin.vert",
"DocumentMoniker": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_coin.vert",
"RelativeDocumentMoniker": "projekt_grk\\shaders\\shader_coin.vert",
"ToolTip": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\shaders\\shader_coin.vert",
"RelativeToolTip": "projekt_grk\\shaders\\shader_coin.vert",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAoAAAA9AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-02-26T19:01:39.656Z"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "ex_7_1.hpp",
"DocumentMoniker": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\src\\ex_7_1.hpp",
"RelativeDocumentMoniker": "projekt_grk\\src\\ex_7_1.hpp",
"ToolTip": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\src\\ex_7_1.hpp",
"RelativeToolTip": "projekt_grk\\src\\ex_7_1.hpp",
"ViewState": "AQIAAAgBAAAAAAAAAADgvxwBAAABAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-02-25T17:55:58.673Z",
"WhenOpened": "2024-02-29T07:37:23.837Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "main.cpp",
"DocumentMoniker": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\src\\main.cpp",
"RelativeDocumentMoniker": "projekt_grk\\src\\main.cpp",
"ToolTip": "C:\\Users\\maksg\\Documents\\Grafika_2024\\projekt_grk\\src\\main.cpp",
"RelativeToolTip": "projekt_grk\\src\\main.cpp",
"ViewState": "AQIAABcAAAAAAAAAAAAtwCYAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-02-26T20:07:44.538Z"
}
]
}

Binary file not shown.

Binary file not shown.

View File

@ -5,16 +5,16 @@ C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\minwindef.h(1
C:\Users\maksg\Documents\Grafika_2024\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123,1):
zobacz poprzednią definicję „APIENTRY”
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(94,10): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(92,10): warning C4305: "inicjowanie": obcięcie z "double" do "float"
(kompilowanie pliku źródłowego „src/main.cpp”)
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(140,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(138,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
(kompilowanie pliku źródłowego „src/main.cpp”)
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(213,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(211,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
(kompilowanie pliku źródłowego „src/main.cpp”)
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(231,29): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\maksg\Documents\Grafika_2024\projekt_grk\src\ex_7_1.hpp(229,29): warning C4305: "inicjowanie": obcięcie z "double" do "float"
(kompilowanie pliku źródłowego „src/main.cpp”)
Box.obj : warning LNK4075: zignorowano opcję „/EDITANDCONTINUE” z powodu określenia opcji „/INCREMENTAL:NO”

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,12 +1,18 @@
#version 430 core
float AMBIENT = 0.1;
uniform vec3 color;
uniform vec3 lightPos;
out vec4 FinalColor;
in vec3 vecNormal;
in vec3 worldPos;
out vec4 finalColor;
void main()
{
FinalColor = vec4(color, 1.0);
vec3 lightDir = normalize(lightPos-worldPos);
vec3 normal = normalize(vecNormal);
float diffuse=max(0,dot(normal,lightDir));
finalColor = vec4(color*min(1,AMBIENT+diffuse), 1.0);
}

View File

@ -6,8 +6,12 @@ layout(location = 1) in vec3 vertexNormal;
uniform mat4 transformation;
uniform mat4 modelMatrix;
out vec3 vecNormal;
out vec3 worldPos;
void main()
{
gl_Position = transformation * vec4(vertexPosition, 1.0);
worldPos = (modelMatrix* vec4(vertexPosition,1)).xyz;
vecNormal = (modelMatrix* vec4(vertexNormal,0)).xyz;
gl_Position = transformation * vec4(vertexPosition, 1.0);
}