Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
imt2531-assignment2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Overkill Studios
imt2531-assignment2
Commits
483b9ef5
Commit
483b9ef5
authored
6 years ago
by
Halvor Smedås
Browse files
Options
Downloads
Patches
Plain Diff
removed cam debug error model
parent
c14dc433
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
assets/shaders/subsurfaceScatter.glsl
+1
-1
1 addition, 1 deletion
assets/shaders/subsurfaceScatter.glsl
src/main.cpp
+4
-3
4 additions, 3 deletions
src/main.cpp
with
5 additions
and
4 deletions
assets/shaders/subsurfaceScatter.glsl
+
1
−
1
View file @
483b9ef5
...
...
@@ -49,7 +49,7 @@ void main() {
//fragNormal = vec3(rotatedNormal);
vertex_color_out
=
rotatedNormal
;
texCoord
=
uv
;
fragNormal
=
mat3
(
transpose
(
inverse
(
m2w
)))
*
normal
;
fragNormal
=
mat3
(
transpose
(
inverse
(
m2w
)))
*
normal
;
//http://www.lighthouse3d.com/tutorials/glsl-12-tutorial/the-normal-matrix/
vec4
out_position
=
MVP
(
position
);
gl_Position
=
out_position
;
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
4
−
3
View file @
483b9ef5
...
...
@@ -135,10 +135,10 @@ int main()
lightBuf
.
update
(
light1PosIndex
,
16
,
&
(
lightData
[
1
]));
lightBuf
.
update
(
light2PosIndex
,
16
,
&
(
lightData
[
2
]));
}
CameraTransform
cameraTransform
=
((
EntityCamera
*
)
Scene
::
getEntity
(
cameraID
))
->
m_cameraTransform
;
// UPDATE CAMERA MATRICES
{
CameraTransform
cameraTransform
=
((
EntityCamera
*
)
Scene
::
getEntity
(
cameraID
))
->
m_cameraTransform
;
//CameraTransform cameraTransform = ((EntityCamera*)Scene::getEntity(cameraID))-> m_cameraTransform;
matrixBuf
.
update
(
projectionIndex
,
sizeof
(
CameraTransform
),
&
cameraTransform
);
}
...
...
@@ -146,8 +146,9 @@ int main()
// Draws all the models in the scene.
Scene
::
draw
(
t
);
glm
::
mat4
camPosDebugM2W
=
glm
::
translate
(
glm
::
mat4
(
1
),
glm
::
vec3
(
cameraTransform
.
position
));
Renderer
::
draw
(
ModelSystem
::
getById
(
0
),
camPosDebugM2W
,
t
);
//This can be done to debug positions
//glm::mat4 camPosDebugM2W = glm::translate(glm::mat4(1), glm::vec3(cameraTransform.position));
//Renderer::draw(ModelSystem::getById(0), camPosDebugM2W, t);
glfwSwapBuffers
(
window
);
glfwPollEvents
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment