Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
edge-of-space
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dario Seyb
edge-of-space
Commits
60f03fa1
Commit
60f03fa1
authored
Dec 10, 2015
by
Dario Seyb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes to sun material
parent
88178002
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
data/shader/DeferredCombine.fsh
data/shader/DeferredCombine.fsh
+1
-1
src/game/src/main.cpp
src/game/src/main.cpp
+3
-3
No files found.
data/shader/DeferredCombine.fsh
View file @
60f03fa1
...
...
@@ -90,5 +90,5 @@ void main()
vec3 specularColor = pow(specularFactor, 210) * uLightColor.rgb;
oColor = vec4((diffuseColor + specularColor) * color.rgb * uLightColor.a * shadowFactor(worldPosition) + emissive.rgb, 1);
oColor = vec4((diffuseColor + specularColor) * color.rgb * uLightColor.a
/(lightDistance * lightDistance)
* shadowFactor(worldPosition) + emissive.rgb, 1);
}
src/game/src/main.cpp
View file @
60f03fa1
...
...
@@ -85,7 +85,7 @@ int main(int argc, char *argv[]) {
Geometry
geom2
=
{
vaoTeapot
};
// Create a material that uses the loaded shader program
Material
checkerboardMat
=
{
glm
::
vec4
{
1
,
1
,
1
,
1
},
glm
::
vec4
{
1
,
1
,
1
,
1
},
checkboardTexture
,
pbrShader
};
Material
sunMaterial
=
{
glm
::
vec4
{
1
,
1
,
1
,
1
},
glm
::
vec4
{
1
,
1
,
1
,
1
},
checkboardTexture
,
pbrShader
};
Material
transparentMat
=
{
glm
::
vec4
{
1
,
1
,
1
,
1
},
glm
::
vec4
{
0
,
0
,
0
,
1
},
testTransparencyTexture
,
pbrShader
};
// Let's create a placeholder sun
...
...
@@ -93,9 +93,9 @@ int main(int argc, char *argv[]) {
// Add a transform component to it so we are able to position it in space
auto
sunTransform
=
sun
.
assign
<
Transform
>
();
// Add a Drawable component to it so the renderer has something to draw
sun
.
assign
<
Drawable
>
(
geom1
,
checkerboardMat
);
sun
.
assign
<
Drawable
>
(
geom1
,
sunMaterial
);
sunTransform
->
scale
=
glm
::
vec3
(
2
,
2
,
2
);
sun
.
assign
<
Light
>
(
glm
::
vec4
(
1
,
1
,
1
,
1
),
glm
::
vec3
(
1
,
0
,
0
),
false
);
sun
.
assign
<
Light
>
(
glm
::
vec4
(
1
,
1
,
1
,
400
),
glm
::
vec3
(
1
,
0
,
0
),
false
);
// create a planet!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment