Lighting

Started by
2 comments, last by Hippokrates 21 years, 8 months ago
I have written a kind of sprite system that maintains a list of sprites. When I call its render function each sprite manually transforms its vertices and stuffs them into a global vertexbuffer. This works so far. But how can I apply alpha blending to them sprites? I have tried lighting too but if I switch the light off nothing can be seen (of course) but if I switch it on every one object appears totally lit and the others show no kind of "special effect". But still, how do I apply alpha blending? Im Anfang war die Tat... Faust
Im Anfang war die Tat...Faust
Advertisement
Ok the title of the thread is misleading, but I still need help :d.

Im Anfang war die Tat...
Faust
Im Anfang war die Tat...Faust
What API are you using (Direct3D, OpenGL, etc.)? Right now I am working with the ID3DXSprite interface of Direct3D 8.1, and it works great.

In order for a triangle/sprite to show up when lighting is enabled, you must apply a material to the triangle. I haven''t done much with materials or lighting yet, but there are plenty of people on this forum that would know more (plus there are probably a lot of threads discussing materials/lighting/etc.)
If you want, you can just apply lighting by adjusting the RGB values of each of your sprites.

Post what API and language you''re using, and more people will be able to help you better.

Good luck...

-Mike
I am using D3D too but I wrote my own sprite interface.
Well the name sprite is not actually correct because it is a simple mechanism to display quads in 3D space that can easiliy be tranformed at feature texture animation.
So it is just vertices featuring position, normal, diffuse color and texture coordinates.
They are transformed by hand and stuffed into a vertex buffer and then rendered according to texture.

Im Anfang war die Tat...
Faust
Im Anfang war die Tat...Faust

This topic is closed to new replies.

Advertisement