-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add LidarVisual point colors for Ogre1 (#124)
* Added Point colors for Ogre1 Signed-off-by: Mihir Kulkarni <[email protected]> * check if vector size equal Signed-off-by: Mihir Kulkarni <[email protected]> * default color of points set to Blue Signed-off-by: Mihir Kulkarni <[email protected]> * optimise to avoid color search Signed-off-by: Mihir Kulkarni <[email protected]> * windows error fix Signed-off-by: Mihir Kulkarni <[email protected]> * minor edit Signed-off-by: Mihir Kulkarni <[email protected]>
- Loading branch information
Showing
7 changed files
with
125 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#version 120 | ||
|
||
void main() | ||
{ | ||
gl_FragColor = gl_Color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#version 120 | ||
|
||
// Generic vertex shader for point sprites | ||
// sets position and point size. | ||
// Works for perspective and orthographic projection. | ||
|
||
uniform mat4 worldviewproj_matrix; | ||
|
||
void main() | ||
{ | ||
gl_Position = worldviewproj_matrix * gl_Vertex; | ||
gl_FrontColor = gl_Color; | ||
gl_PointSize = 10 / gl_Position.w; | ||
} |
30 changes: 30 additions & 0 deletions
30
ogre/src/media/materials/scripts/point_cloud_point.material
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
vertex_program PointCloudVS glsl | ||
{ | ||
source point_vs.glsl | ||
|
||
default_params | ||
{ | ||
param_named_auto worldviewproj_matrix worldviewproj_matrix | ||
} | ||
} | ||
|
||
fragment_program PointCloudFS glsl | ||
{ | ||
source point_fs.glsl | ||
|
||
} | ||
|
||
material PointCloudPoint | ||
{ | ||
technique | ||
{ | ||
pass | ||
{ | ||
point_size_attenuation on | ||
point_sprites on | ||
vertex_program_ref PointCloudVS {} | ||
fragment_program_ref PointCloudFS {} | ||
} | ||
} | ||
} |