Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
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
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Archive
Alchemy Viewer
Commits
622d4f39
Commit
622d4f39
authored
12 years ago
by
David Parks
Browse files
Options
Downloads
Patches
Plain Diff
MAINT-2242 Fix for shader compilation errors on Intel HD graphics chips.
parent
c842494b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/app_settings/shaders/class1/objects/previewV.glsl
+36
-3
36 additions, 3 deletions
...newview/app_settings/shaders/class1/objects/previewV.glsl
indra/newview/llviewershadermgr.cpp
+4
-3
4 additions, 3 deletions
indra/newview/llviewershadermgr.cpp
with
40 additions
and
6 deletions
indra/newview/app_settings/shaders/class1/objects/previewV.glsl
+
36
−
3
View file @
622d4f39
...
@@ -23,9 +23,6 @@
...
@@ -23,9 +23,6 @@
* $/LicenseInfo$
* $/LicenseInfo$
*/
*/
float
calcDirectionalLight
(
vec3
n
,
vec3
l
);
float
calcPointLightOrSpotLight
(
vec3
v
,
vec3
n
,
vec4
lp
,
vec3
ln
,
float
la
,
float
is_pointlight
);
uniform
mat3
normal_matrix
;
uniform
mat3
normal_matrix
;
uniform
mat4
texture_matrix0
;
uniform
mat4
texture_matrix0
;
uniform
mat4
modelview_matrix
;
uniform
mat4
modelview_matrix
;
...
@@ -45,6 +42,42 @@ uniform vec3 light_direction[8];
...
@@ -45,6 +42,42 @@ uniform vec3 light_direction[8];
uniform
vec3
light_attenuation
[
8
];
uniform
vec3
light_attenuation
[
8
];
uniform
vec3
light_diffuse
[
8
];
uniform
vec3
light_diffuse
[
8
];
//===================================================================================================
//declare these here explicitly to separate them from atmospheric lighting elsewhere to work around
//drivers that are picky about functions being declared but not defined even if they aren't called
float
calcDirectionalLight
(
vec3
n
,
vec3
l
)
{
float
a
=
max
(
dot
(
n
,
l
),
0
.
0
);
return
a
;
}
float
calcPointLightOrSpotLight
(
vec3
v
,
vec3
n
,
vec4
lp
,
vec3
ln
,
float
la
,
float
is_pointlight
)
{
//get light vector
vec3
lv
=
lp
.
xyz
-
v
;
//get distance
float
d
=
length
(
lv
);
//normalize light vector
lv
*=
1
.
0
/
d
;
//distance attenuation
float
da
=
clamp
(
1
.
0
/
(
la
*
d
),
0
.
0
,
1
.
0
);
// spotlight coefficient.
float
spot
=
max
(
dot
(
-
ln
,
lv
),
is_pointlight
);
da
*=
spot
*
spot
;
// GL_SPOT_EXPONENT=2
//angular attenuation
da
*=
calcDirectionalLight
(
n
,
lv
);
return
da
;
}
//====================================================================================================
void
main
()
void
main
()
{
{
//transform vertex
//transform vertex
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llviewershadermgr.cpp
+
4
−
3
View file @
622d4f39
...
@@ -2025,11 +2025,11 @@ BOOL LLViewerShaderMgr::loadShadersObject()
...
@@ -2025,11 +2025,11 @@ BOOL LLViewerShaderMgr::loadShadersObject()
if
(
success
)
if
(
success
)
{
{
gObjectPreviewProgram
.
mName
=
"Simple Shader"
;
gObjectPreviewProgram
.
mName
=
"Simple Shader"
;
gObjectPreviewProgram
.
mFeatures
.
calculatesLighting
=
tru
e
;
gObjectPreviewProgram
.
mFeatures
.
calculatesLighting
=
fals
e
;
gObjectPreviewProgram
.
mFeatures
.
calculatesAtmospherics
=
false
;
gObjectPreviewProgram
.
mFeatures
.
calculatesAtmospherics
=
false
;
gObjectPreviewProgram
.
mFeatures
.
hasGamma
=
tru
e
;
gObjectPreviewProgram
.
mFeatures
.
hasGamma
=
fals
e
;
gObjectPreviewProgram
.
mFeatures
.
hasAtmospherics
=
false
;
gObjectPreviewProgram
.
mFeatures
.
hasAtmospherics
=
false
;
gObjectPreviewProgram
.
mFeatures
.
hasLighting
=
tru
e
;
gObjectPreviewProgram
.
mFeatures
.
hasLighting
=
fals
e
;
gObjectPreviewProgram
.
mFeatures
.
mIndexedTextureChannels
=
0
;
gObjectPreviewProgram
.
mFeatures
.
mIndexedTextureChannels
=
0
;
gObjectPreviewProgram
.
mFeatures
.
disableTextureIndex
=
true
;
gObjectPreviewProgram
.
mFeatures
.
disableTextureIndex
=
true
;
gObjectPreviewProgram
.
mShaderFiles
.
clear
();
gObjectPreviewProgram
.
mShaderFiles
.
clear
();
...
@@ -2037,6 +2037,7 @@ BOOL LLViewerShaderMgr::loadShadersObject()
...
@@ -2037,6 +2037,7 @@ BOOL LLViewerShaderMgr::loadShadersObject()
gObjectPreviewProgram
.
mShaderFiles
.
push_back
(
make_pair
(
"objects/previewF.glsl"
,
GL_FRAGMENT_SHADER_ARB
));
gObjectPreviewProgram
.
mShaderFiles
.
push_back
(
make_pair
(
"objects/previewF.glsl"
,
GL_FRAGMENT_SHADER_ARB
));
gObjectPreviewProgram
.
mShaderLevel
=
mVertexShaderLevel
[
SHADER_OBJECT
];
gObjectPreviewProgram
.
mShaderLevel
=
mVertexShaderLevel
[
SHADER_OBJECT
];
success
=
gObjectPreviewProgram
.
createShader
(
NULL
,
NULL
);
success
=
gObjectPreviewProgram
.
createShader
(
NULL
,
NULL
);
gObjectPreviewProgram
.
mFeatures
.
hasLighting
=
true
;
}
}
if
(
success
)
if
(
success
)
...
...
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