Archived

This topic is now archived and is closed to further replies.

Ketzal

OpenGL Bright lights in OpenGL

Recommended Posts

Ketzal    122
Maybe I just haven''t read the docs as I would but, is there a way to have a REALLY BRIGHT light using OpenGL''s lighting facility or the only way to achieve this it to set each vertex color manually? I tried using GL_SPECULAR with (1.0,1.0,1.0,1.0) and GL_DIFUSSE with (1.0,1.0,1.0,1.0), but the brightest color it produces is just the texture''s original colors, just a little brighter, (at first I used only two lights, then three, but the only one that changes is the diffuse color, not the highlight) Can anyone help?

Share this post


Link to post
Share on other sites
Obelix    122
Your texture will not get much of a highlight with the normal GL specular but the separate specular extension will get the job done. A little demo, information and links from ATI http://www.ati.com/na/pages/resource_centre/dev_rel/sdk/RadeonSDK/Html/Samples/OpenGL/RadeonSeparateSpecular.html

I think that most cards supports this extension.

Share this post


Link to post
Share on other sites
Krippy2k    134
I don''t think the lighting values are clamped. I''m not sure if it is standard, but using 10.0, 10.0, 10.0, 10.0 instead of all 1.0s makes a bright light on a GeForce 2 GTS pro.

Share this post


Link to post
Share on other sites
zedzeek    528
if u use texenv modulate, things will only darken. to brighten use modulate2 or add

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
gph-gw    122
quote:
Original post by Krippy2k
I don''t think the lighting values are clamped. I''m not sure if it is standard, but using 10.0, 10.0, 10.0, 10.0 instead of all 1.0s makes a bright light on a GeForce 2 GTS pro.




It also does that on my Voodoo. Since it''s not in an extention it might be standard.

Share this post


Link to post
Share on other sites
Ketzal    122
Nope. Using any values above 1.0, 1.0, 1.0, 1.0 effectively defeats lighting on my TNT2 M64 (textures are presented on its original colors).

Share this post


Link to post
Share on other sites
Krippy2k    134
Hmmm... Well I just noticed that it actually doesn''t get any brighter than the texture color that way. Apparently the reason I was thinkin it was getting brighter was because when I use all 1.0s for an ambient light it is full brightness when I am turned 1 direction, then when I rotate 180 degrees it dims to about half brightness? lol. I didn''t notice before that it changed when I moved that way.

If I set everything to 10.0s it doesn''t change when I move so it is always full brightness. Wierd stuff.

I''m interested now. lol

What do you mean by add or modulate2?

The only texenv functions that I see are GL_MODULATE, GL_BLEND and GL_DECAL ??

There is a GL_ADD but it is regarding the accumulation buffer.

??


THanks
Krippy

Share this post


Link to post
Share on other sites
Ketzal    122
Try passing GL_ADD to gl_TexEnvf. It uses an additive drawing mode to draw the texture. It DOES light things, but you miss ALL shadows!! Guess you can''t have everything (groan)...

Share this post


Link to post
Share on other sites
Krippy2k    134
Ahhh... Does make it brighter... But murders alphablending... lol. Everything I have with any transparency comes out as a white block.
Oh well.

Share this post


Link to post
Share on other sites
zedzeek    528
not bright enuf, now to bright sheesh some ppl
u also might wanna have a look at the tex_env_combine extension it gives a bit more control over ''brightness''

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
aDasTRa    122
i dont know if you guys are already doing this, but you may want to turn off lighting before you do any blending, then turn it back on when done. this may be a redundant comment, but i know i wasn''t doin it at first and it screwed up my rendering. also, you may need to leave all the blending stuff to the end.

<(o)>

Share this post


Link to post
Share on other sites

  • Similar Content

    • By povilaslt2
      Hello. I'm Programmer who is in search of 2D game project who preferably uses OpenGL and C++. You can see my projects in GitHub. Project genre doesn't matter (except MMO's :D).
    • By ZeldaFan555
      Hello, My name is Matt. I am a programmer. I mostly use Java, but can use C++ and various other languages. I'm looking for someone to partner up with for random projects, preferably using OpenGL, though I'd be open to just about anything. If you're interested you can contact me on Skype or on here, thank you!
      Skype: Mangodoor408
    • By tyhender
      Hello, my name is Mark. I'm hobby programmer. 
      So recently,I thought that it's good idea to find people to create a full 3D engine. I'm looking for people experienced in scripting 3D shaders and implementing physics into engine(game)(we are going to use the React physics engine). 
      And,ye,no money =D I'm just looking for hobbyists that will be proud of their work. If engine(or game) will have financial succes,well,then maybe =D
      Sorry for late replies.
      I mostly give more information when people PM me,but this post is REALLY short,even for me =D
      So here's few more points:
      Engine will use openGL and SDL for graphics. It will use React3D physics library for physics simulation. Engine(most probably,atleast for the first part) won't have graphical fron-end,it will be a framework . I think final engine should be enough to set up an FPS in a couple of minutes. A bit about my self:
      I've been programming for 7 years total. I learned very slowly it as "secondary interesting thing" for like 3 years, but then began to script more seriously.  My primary language is C++,which we are going to use for the engine. Yes,I did 3D graphics with physics simulation before. No, my portfolio isn't very impressive. I'm working on that No,I wasn't employed officially. If anybody need to know more PM me. 
       
    • By Zaphyk
      I am developing my engine using the OpenGL 3.3 compatibility profile. It runs as expected on my NVIDIA card and on my Intel Card however when I tried it on an AMD setup it ran 3 times worse than on the other setups. Could this be a AMD driver thing or is this probably a problem with my OGL code? Could a different code standard create such bad performance?
    • By Kjell Andersson
      I'm trying to get some legacy OpenGL code to run with a shader pipeline,
      The legacy code uses glVertexPointer(), glColorPointer(), glNormalPointer() and glTexCoordPointer() to supply the vertex information.
      I know that it should be using setVertexAttribPointer() etc to clearly define the layout but that is not an option right now since the legacy code can't be modified to that extent.
      I've got a version 330 vertex shader to somewhat work:
      #version 330 uniform mat4 osg_ModelViewProjectionMatrix; uniform mat4 osg_ModelViewMatrix; layout(location = 0) in vec4 Vertex; layout(location = 2) in vec4 Normal; // Velocity layout(location = 3) in vec3 TexCoord; // TODO: is this the right layout location? out VertexData { vec4 color; vec3 velocity; float size; } VertexOut; void main(void) { vec4 p0 = Vertex; vec4 p1 = Vertex + vec4(Normal.x, Normal.y, Normal.z, 0.0f); vec3 velocity = (osg_ModelViewProjectionMatrix * p1 - osg_ModelViewProjectionMatrix * p0).xyz; VertexOut.velocity = velocity; VertexOut.size = TexCoord.y; gl_Position = osg_ModelViewMatrix * Vertex; } What works is the Vertex and Normal information that the legacy C++ OpenGL code seem to provide in layout location 0 and 2. This is fine.
      What I'm not getting to work is the TexCoord information that is supplied by a glTexCoordPointer() call in C++.
      Question:
      What layout location is the old standard pipeline using for glTexCoordPointer()? Or is this undefined?
       
      Side note: I'm trying to get an OpenSceneGraph 3.4.0 particle system to use custom vertex, geometry and fragment shaders for rendering the particles.
  • Popular Now