Engine Lighting

Started by
6 comments, last by xycsoscyx 7 years, 7 months ago

Hi, how would you program the lighting ?

There are only 8 lights avaiable, i would like a lot more.

Whats the trick ?

greetings

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

Advertisement

A little more information about the architecture of your engine / game project would be great. But either way, if you are seeking a method for rendering a large quantity of lights, I would start by looking into Deferred Rendering (Again, knowing what you have would help). In case your project is already following the path of a Deferred Renderer (Or forward) and you would like "more" lights with less cost, I would look into Tiled / Clustered Deferred Shading (Also applies for forward rendering)

Good luck!

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

By saying that there are only 8 lights available I guess you're using legacy OpenGL/fixed function rendering and should move into a more modern style where there are no lights in the API, instead you program them manually.

Aether3D Game Engine: https://github.com/bioglaze/aether3d

Blog: http://twiren.kapsi.fi/blog.html

Control

Hi, i,m using DX9.0.

There are 8 lights for usage.

What is modern style ?, are there no 8 lights in DX11 by example ?

Or should i use those 8 lights with different settings for each thing rendered ?

Its nice to know what to look into Migi,

it would be better for me to tell how it is roughly done,

if i understand the ideas that are available, i can try.

thanks

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

When you use shaders you program the light yourself. So you can store light information into buffers/textures for example which can then be retrieve in the vertex/pixelshader to process more than 8 lights. But if you are using the fixed pipeline you cannot use more than 8 lights. If you want to use more than 8 lights you will have to render the scene more than once with additive blending.

Even when stuck with 8 lights and no deferred rendering techniques you can render far more lights.

Just do multiple passes.

Hi, thanks for the reply`s.

I dont know anything about shaders, i used vertexbuffer for the map so far.

I would like to have by example all cars 4 lights, and a lot of cars + scene lighting from lanterns all together.

Rebuilding vertexbuffer every frame cost to much, so i have to take a look what shader exacly is compared to vertexbuffer.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

Shaders and vertex buffers are different things, and likely you'll still be using a vertex buffer for data, even when using shaders for rendering.

Vertex buffers just store the vertex data, note that if you are rebuilding it every frame then you may want to look into better methods. For a typical model (a car model, for instance), the car itself doesn't change every frame, only a single matrix that transforms the car model into world space. You would only have to update a single matrix to move the car, instead of rebuilding the entire vertex buffer.

Shaders are how everything gets handled, vertex shaders transform input data into screen space, fragment shaders determine the color of every pixel, etc. In a fixed function pipeline, the transformation was, as the name implies, fixed. You can modify the parameters, but the equation will always stay the same. With shaders, you write the entire process yourself.

Buffers supply the data, while shaders modify the data.

This topic is closed to new replies.

Advertisement