Hello there, long time no see.
I've been tinkering with lighting, but I found no help in the docs of PSY-Q about having a polygon as a light source.
I would want to make, for example, a white quad polygon light up (basically having soft edges with transparency), instead of "being lit up by light rays".
Would it be possible to do that ? Or would I need a texture sprite ?
Thanks for any answer !
Is it possible to set a polygon as light source ?
- New Nova
- Active PSXDEV User
- Posts: 69
- Joined: October 27th, 2018, 8:48 am
- I am a: Collector, developper, artist
- Motto: RTFM
- PlayStation Model: DTL-H2000
- Location: France
- Contact:
Is it possible to set a polygon as light source ?
Development PC : Generic PC, Intel Pentium II 233MHz, 392MB RAM, NVIDIA GeForce4 MX 440 (AGP), Dual-Boot Windows 98 SE (OEM Full) + Windows 2000 Professional SP4 (Retail)
Development Setup : DTL-H2000 board + DTL-H2010 CD-ROM drive + DTL-H2080 Controller Box + DTL-H201A Graphic Artist Board
Retail Unit : SCPH-1002 + XplorerFX + caetla + modchip + activity LED mod
Development Setup : DTL-H2000 board + DTL-H2010 CD-ROM drive + DTL-H2080 Controller Box + DTL-H201A Graphic Artist Board
Retail Unit : SCPH-1002 + XplorerFX + caetla + modchip + activity LED mod
What do you want to do there?
Do you just want the direction (and distance/intensity) from the source, like for a candle or light bulb?
Or the actual polygon shape, like from a rectangular window?
Do you just want the direction (and distance/intensity) from the source, like for a candle or light bulb?
Or the actual polygon shape, like from a rectangular window?
- New Nova
- Active PSXDEV User
- Posts: 69
- Joined: October 27th, 2018, 8:48 am
- I am a: Collector, developper, artist
- Motto: RTFM
- PlayStation Model: DTL-H2000
- Location: France
- Contact:
Yeah, like a light bulb. I want my polygon to BE a light source, being able to glow. I've got some answers in the discord that with generated sprite/CLUT with transparency, I could achieve it.
Development PC : Generic PC, Intel Pentium II 233MHz, 392MB RAM, NVIDIA GeForce4 MX 440 (AGP), Dual-Boot Windows 98 SE (OEM Full) + Windows 2000 Professional SP4 (Retail)
Development Setup : DTL-H2000 board + DTL-H2010 CD-ROM drive + DTL-H2080 Controller Box + DTL-H201A Graphic Artist Board
Retail Unit : SCPH-1002 + XplorerFX + caetla + modchip + activity LED mod
Development Setup : DTL-H2000 board + DTL-H2010 CD-ROM drive + DTL-H2080 Controller Box + DTL-H201A Graphic Artist Board
Retail Unit : SCPH-1002 + XplorerFX + caetla + modchip + activity LED mod
The part about Using a "polygon as light source" is highly confusing. I am almost sure that you mean something else:
For a light bulb you would very much want to think about the light source as a "point" (not a polygon) in the middle of the bulb.
Or if you mean that you want to draw a transparent polygon around the bulb, that would be the "target", not the source.
The transparent polygon idea is a bit of a lame trick, with some disadvantages:
1) Transparent color addition would illuminate everything (including black colors, and including pixels at distant Z coordinates. So it would look more like "foggy air" than like actual "light".
2) It would illuminate everything, including polygons that are facing away from the light source.
Nethertheless, it could look okay if it's done decently (like using a dark gray color, just bright enough to light up the surrounding pixels a bit).
For real lighting you would need to change the light vector: For each and every polygon, compute the direction from the light source to the current polygon, and use that as light vector to compute the light color (and perhaps dim the color depending the distance). If you have other light source(s), then compute those, too, and apply the sum of all light colors as polygon color. I guess that's still within scope of the PSX hardware (but it might get very difficult if you want to implement shadows).
For a light bulb you would very much want to think about the light source as a "point" (not a polygon) in the middle of the bulb.
Or if you mean that you want to draw a transparent polygon around the bulb, that would be the "target", not the source.
The transparent polygon idea is a bit of a lame trick, with some disadvantages:
1) Transparent color addition would illuminate everything (including black colors, and including pixels at distant Z coordinates. So it would look more like "foggy air" than like actual "light".
2) It would illuminate everything, including polygons that are facing away from the light source.
Nethertheless, it could look okay if it's done decently (like using a dark gray color, just bright enough to light up the surrounding pixels a bit).
For real lighting you would need to change the light vector: For each and every polygon, compute the direction from the light source to the current polygon, and use that as light vector to compute the light color (and perhaps dim the color depending the distance). If you have other light source(s), then compute those, too, and apply the sum of all light colors as polygon color. I guess that's still within scope of the PSX hardware (but it might get very difficult if you want to implement shadows).
- New Nova
- Active PSXDEV User
- Posts: 69
- Joined: October 27th, 2018, 8:48 am
- I am a: Collector, developper, artist
- Motto: RTFM
- PlayStation Model: DTL-H2000
- Location: France
- Contact:
No, I don't mean a transparent polygon in my case.
Let me try to explain what I want to achieve, it might be easier to understand :
I want to achieve a perspective grid of white quads, like those "synthwave grids", but only in white. Without lighting, it's just a grid with hard borders. With lighting in the way I want, those borders/edges would be soft and spread around, at least in X/Y axis. With what I found about the lighting system is that it will update the color of the polygon in relation to the light color, intensity and direction. But it's a surface being lit up, hard borders/edges are still there, the polygon just changed shade.
What I want would be either :
- A way to make the polygon shine or glow, as a light source
- A way to make the polygon reflect light in a way that it would make the borders softer and light spreading around polygons.
For now I'm stuck with the perspective grid part, I have a grid of polygons that can be moved, but not in perspective. My guess would be to put that in a 3D environment, and move the camera in a way that would make it perspective-like. So way more advanced than anything I've done, but manageable.
Any help on that is also welcome, mostly simple code example to set a coordinate system and stuff.
But I digress. I will make a separate app with just 1 polygon and try what I can, then merge.
On the PSXDEV discord, the idea of a runtime generated sprite with transparency CLUT system have been told to me. I have some more idea, but it's worth a shot once I get to understand and implement it.
Let me try to explain what I want to achieve, it might be easier to understand :
I want to achieve a perspective grid of white quads, like those "synthwave grids", but only in white. Without lighting, it's just a grid with hard borders. With lighting in the way I want, those borders/edges would be soft and spread around, at least in X/Y axis. With what I found about the lighting system is that it will update the color of the polygon in relation to the light color, intensity and direction. But it's a surface being lit up, hard borders/edges are still there, the polygon just changed shade.
What I want would be either :
- A way to make the polygon shine or glow, as a light source
- A way to make the polygon reflect light in a way that it would make the borders softer and light spreading around polygons.
For now I'm stuck with the perspective grid part, I have a grid of polygons that can be moved, but not in perspective. My guess would be to put that in a 3D environment, and move the camera in a way that would make it perspective-like. So way more advanced than anything I've done, but manageable.
Any help on that is also welcome, mostly simple code example to set a coordinate system and stuff.
But I digress. I will make a separate app with just 1 polygon and try what I can, then merge.
On the PSXDEV discord, the idea of a runtime generated sprite with transparency CLUT system have been told to me. I have some more idea, but it's worth a shot once I get to understand and implement it.
Development PC : Generic PC, Intel Pentium II 233MHz, 392MB RAM, NVIDIA GeForce4 MX 440 (AGP), Dual-Boot Windows 98 SE (OEM Full) + Windows 2000 Professional SP4 (Retail)
Development Setup : DTL-H2000 board + DTL-H2010 CD-ROM drive + DTL-H2080 Controller Box + DTL-H201A Graphic Artist Board
Retail Unit : SCPH-1002 + XplorerFX + caetla + modchip + activity LED mod
Development Setup : DTL-H2000 board + DTL-H2010 CD-ROM drive + DTL-H2080 Controller Box + DTL-H201A Graphic Artist Board
Retail Unit : SCPH-1002 + XplorerFX + caetla + modchip + activity LED mod
Okay, now I am really confused, and I think I do misunderstand or dont understand what you want to do.
With "transparent polygon", I did mean the "transparent sprite" that you had mentioned, it doesn't matter so much if you render it as sprite or polygon.
With synthwave grid you mean something like the blue lines in the Beamrider game, but in white, and rendered as solid white quads instead of white lines? That is... if you arrange all white quads in a grid... then you want the whole screen to become white... so he user usally can't see the grid?
Making a polygon shine like a light source is very easy (so easy that I don't really believe that you are asking how to do that). But anyways: Imagine you have a lightbulb that has a gray color when switched off. When switched on, change it to a brighter color, like white.
That's really as much as you can do about displaying the light source. Plain and simple.
What people are usually interested in is how the light source will affect the color of other polygons in the scenery. Although, you didn't mention if your secenery does have any other polygons or not. Or at least, not that I could understand it. Is the grid made of light beams that are your light source? Or is there a lightbulb hoverying above the grid, and the bulb is meant to case light onto the grid?
And you mentioned those "soft" edges. Light usually doesn't do "soft" things, at least not in a vacuum, or in a normal environment with clear air: Everything is sharp and clear, not soft.
You might get "soft" edges if the air isn't clear. Like filled with dust, fog, smog, smoke, whatever. For such effects you might render a transparent polygon (or transparent sprite, if you prefer) around the light source. Or apply a blur filter to the whole screen.
With "transparent polygon", I did mean the "transparent sprite" that you had mentioned, it doesn't matter so much if you render it as sprite or polygon.
With synthwave grid you mean something like the blue lines in the Beamrider game, but in white, and rendered as solid white quads instead of white lines? That is... if you arrange all white quads in a grid... then you want the whole screen to become white... so he user usally can't see the grid?
Making a polygon shine like a light source is very easy (so easy that I don't really believe that you are asking how to do that). But anyways: Imagine you have a lightbulb that has a gray color when switched off. When switched on, change it to a brighter color, like white.
That's really as much as you can do about displaying the light source. Plain and simple.
What people are usually interested in is how the light source will affect the color of other polygons in the scenery. Although, you didn't mention if your secenery does have any other polygons or not. Or at least, not that I could understand it. Is the grid made of light beams that are your light source? Or is there a lightbulb hoverying above the grid, and the bulb is meant to case light onto the grid?
And you mentioned those "soft" edges. Light usually doesn't do "soft" things, at least not in a vacuum, or in a normal environment with clear air: Everything is sharp and clear, not soft.
You might get "soft" edges if the air isn't clear. Like filled with dust, fog, smog, smoke, whatever. For such effects you might render a transparent polygon (or transparent sprite, if you prefer) around the light source. Or apply a blur filter to the whole screen.
- New Nova
- Active PSXDEV User
- Posts: 69
- Joined: October 27th, 2018, 8:48 am
- I am a: Collector, developper, artist
- Motto: RTFM
- PlayStation Model: DTL-H2000
- Location: France
- Contact:
Ok, let me show you with pictures what I want to achieve, I'll try my best to do it.
First, I want a grid of white quads polygons like this :
Then I want to make it like a perspective view, probably doable by using a coordinate system and changing camera angle, like this : Finally, I would want to make the things glow like this :
First, I want a grid of white quads polygons like this :
Then I want to make it like a perspective view, probably doable by using a coordinate system and changing camera angle, like this : Finally, I would want to make the things glow like this :
You do not have the required permissions to view the files attached to this post.
Development PC : Generic PC, Intel Pentium II 233MHz, 392MB RAM, NVIDIA GeForce4 MX 440 (AGP), Dual-Boot Windows 98 SE (OEM Full) + Windows 2000 Professional SP4 (Retail)
Development Setup : DTL-H2000 board + DTL-H2010 CD-ROM drive + DTL-H2080 Controller Box + DTL-H201A Graphic Artist Board
Retail Unit : SCPH-1002 + XplorerFX + caetla + modchip + activity LED mod
Development Setup : DTL-H2000 board + DTL-H2010 CD-ROM drive + DTL-H2080 Controller Box + DTL-H201A Graphic Artist Board
Retail Unit : SCPH-1002 + XplorerFX + caetla + modchip + activity LED mod
I would draw the lines as Lines, not as Polygons. Especially in the 2nd and 3rd picture:
With the render line command you get lines with constant 1 pixel width. When rendering the lines as textured polygons, then the line width would be rounded down to 0 pixels in some of the more distant polygons.
For the blur effect in the 3rd picture, there are many ways to do that. I would runder it as polygons that contain a blurred gray "+" shape or "L" shape on black background. And then use the render Line command to draw the white line on top of it.
There is no need to use transparency - unless the grid is transparent, and there can appear other objects underneath of the grid.
With the render line command you get lines with constant 1 pixel width. When rendering the lines as textured polygons, then the line width would be rounded down to 0 pixels in some of the more distant polygons.
For the blur effect in the 3rd picture, there are many ways to do that. I would runder it as polygons that contain a blurred gray "+" shape or "L" shape on black background. And then use the render Line command to draw the white line on top of it.
There is no need to use transparency - unless the grid is transparent, and there can appear other objects underneath of the grid.
Who is online
Users browsing this forum: No registered users and 5 guests