Hi!
I'm using the OpenGL driver and nodes with the EMT_NORMAL_MAP_SOLID material are way too dark in my opinion.
Do they ignore the global ambient value (setAmbientLight)? Because the parts of the mesh that do not face the light directly are pitch black.
I'd like to change that behaviour but im not experienced with shaders (especially not low-level ones).
Can some shader-guy tell me what i have to change in COpenGLNormalMapRenderer.h to make the node brighter/take ambient light into account?
thanks in advance!
Brightness of EMT_NORMAL_MAP_SOLID
I think the place you'd have to change would be in the meat of COpenGLNormalMapRenderer.cpp
I see a lot of hand coded D3D asm code that has been directly translated to its OpenGL equivalent. I'm going to have to get a lot deeper into the OpenGL docs before I'd venture a guess (and this from a guy who's always loved assembly language coding and thinks it would be a hoot to write an OS).
You may find it easier to adjust the colors in the objects you are illuminating. Look at your work on an LCD display before you do. This is probably the correct brightness. I've found that most PC monitors display a bit dark compared to the high end variety found in high end PCs and Macs. When designing a graphic for web I tend to make it a bit brighter to compensate for viewing on older monitors.
I would like to study the OpenGL interface in Irrlicht because I notice it doesn't seem to render textures properly on OpenGL versions prior to 1.3 (for example my eMachines w3080 based on AMD Athlon XP+ and S3 Unichrome K400 chipset). But this is low on my list of priorities at the moment (making the build process for Mac OS more of a generic Irrlicht build, and isolating OS dependent parts from the core rendering engine has precedence for me).
If you feel like rolling up your sleeves and tackling the OpenGL classes in Irrlicht, perhaps you could include a method for determining the version of OpenGL in use and let the code adapt it's interface accordingly (my hunch is having a 1.2, 1.5, and a 2.0 version would allow the engine the broadest compatibility with older hardware while taking advantage of newer features where available. If you do accept this noble quest please consider contributing your improvements to the project!
I see a lot of hand coded D3D asm code that has been directly translated to its OpenGL equivalent. I'm going to have to get a lot deeper into the OpenGL docs before I'd venture a guess (and this from a guy who's always loved assembly language coding and thinks it would be a hoot to write an OS).
You may find it easier to adjust the colors in the objects you are illuminating. Look at your work on an LCD display before you do. This is probably the correct brightness. I've found that most PC monitors display a bit dark compared to the high end variety found in high end PCs and Macs. When designing a graphic for web I tend to make it a bit brighter to compensate for viewing on older monitors.
I would like to study the OpenGL interface in Irrlicht because I notice it doesn't seem to render textures properly on OpenGL versions prior to 1.3 (for example my eMachines w3080 based on AMD Athlon XP+ and S3 Unichrome K400 chipset). But this is low on my list of priorities at the moment (making the build process for Mac OS more of a generic Irrlicht build, and isolating OS dependent parts from the core rendering engine has precedence for me).
If you feel like rolling up your sleeves and tackling the OpenGL classes in Irrlicht, perhaps you could include a method for determining the version of OpenGL in use and let the code adapt it's interface accordingly (my hunch is having a 1.2, 1.5, and a 2.0 version would allow the engine the broadest compatibility with older hardware while taking advantage of newer features where available. If you do accept this noble quest please consider contributing your improvements to the project!
The diffuse colour isnt passed at all, just the light diffuse (which is just the light colour)
Want to add the diffuse just look for the line
press enter at the end of that line, then paste
go to
replace with
and inside this
add this
after this
you figure out how to get the diffuse value to that class, im too lazy to look up the api.
Want to add the diffuse just look for the line
Code: Select all
"PARAM height_scale = program.local[0]; \n"\
Code: Select all
"PARAM gdiffuse= program.local[1]; \n"\
Code: Select all
"MUL outColor, temp, colorMapColor; \n"\
Code: Select all
"MAD outColor, temp, colorMapColor,gdiffuse; \n"\
Code: Select all
void COpenGLNormalMapRenderer::OnSetConstants(IMaterialRendererServices* services, s32 userData)
Code: Select all
f32 diff[] = {diffusered,diffusegreen,diffuseblue,diffusealpha};
services->setPixelShaderConstant(diff, 1, 4);
Code: Select all
f32 c6[] = {factor, factor, factor, factor};
services->setPixelShaderConstant(c6, 0, 1);
"Irrlicht is obese"
If you want modern rendering techniques learn how to make them or go to the engine next door =p
If you want modern rendering techniques learn how to make them or go to the engine next door =p