dreamcast games shaders?

Discussion of topics related to licensed games, software hacking/modification, prototypes, and development kits belongs here. Includes topics related to emulating the Dreamcast console on your computer or on another gaming console. Discussion of Reicast should go in the Official Reicast Forum.
Post Reply
chao2
DCEmu Freak
DCEmu Freak
Posts: 62
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sun Mar 10, 2013 9:55 am
Has thanked: 0
Been thanked: 0

dreamcast games shaders?

Post by chao2 »

What would dreamcast games look like if they had shaders? How much better would these games look compared to unshaded dreamcast games? I already know dreamcast doesn't have shading capabilities so there is no need to explain to me.
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 366
Joined: Wed Mar 30, 2011 12:13 pm
Has thanked: 2 times
Been thanked: 0

Re: dreamcast games shaders?

Post by RyoDC »

As much as good as old games on PC released on hardware not supporting shaders and modern PC games which are released on hardware supporting it.
Just type in google "PC games before 2002" and "PC games after 2002", or simply compare screenshots fromn HL1 and HL2. See the difference with a naked eye.

Though, you would like to have some introduction to what shaders are, if you don't see a difference with the naked eye.

Of course, hardware, on which HL2 was played, was not only imporoved in terms of shader support, it started to have more memory, texture buffers, bandwitch, poly count, et cetra.

Shaders allow you to change the way how you render objects in the scene for every selected batch of objects.

You can have batch of objects, which must have glossy skin. So you render them with the fragment shader which computes specular component for every pixel of the needed object, depending on how this pixel, placed on the object's surface, is turned to a light source, what angle doest it have to it, you can calculate reflection component depending on the object postion in the space and stuff like that.

Without shaders, you had the same settings and same (and very simple) lighting model for every object in the scene.
You were able to turn up and down some parameters, but they didn't affect object as drastically as shaders can do it now on modern hardware by using different shading models and calculating pixel colors for objects using your own algorithms.

That is the main difference - with a hardware supporting your own shaders you can specify how to render object's pixels, on the older hardware you couldn't - you could just affect the parameters of GPU, probably, but shader (lightning calculation model - read, how to calculate pixels colors for an object) was the same for all objects.

PS. Shader program can affect not only fragments pixels, it can also specify how to affect fragment vertices and many more.
So you can create modulated surfaces and many many more.
How do I try to build a Dreamcast toolchain:
Image
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 366
Joined: Wed Mar 30, 2011 12:13 pm
Has thanked: 2 times
Been thanked: 0

Re: dreamcast games shaders?

Post by RyoDC »

As much as good as old games on PC released on hardware not supporting shaders and modern PC games which are released on hardware supporting it.
Just type in google "PC games before 2000" and "PC games after 2000" (I think this is approximately the right time division blade, when consumer GPU's started to support shaders), or simply compare screenshots from HL1 and HL2. See the difference with a naked eye.

Though, you would like to have some introduction to what shaders are, if you don't see a difference with the naked eye.

Of course, hardware, on which HL2 was played, was not only improved in terms of shader support, it started to have more memory, texture buffers, bandwidth, poly count, etc.
Shaders allow you to change the way how you render objects in the scene for every selected batch of objects.

You can have batch of objects, which must have glossy skin. So you render them with the fragment shader which computes specular component for every pixel of the needed object, depending on how this pixel, placed on the object's surface, is turned to a light source, what angle does it have to it, you can calculate reflection component depending on the object position in the space and stuff like that.

Without shaders, you had the same settings and same (and very simple) lighting model for every object in the scene.
You were able to turn up and down some parameters, but they didn't affect object as drastically as shaders can do it now on modern hardware by using different shading models and calculating pixel colors for objects using your own algorithms.

That is the main difference - with a hardware supporting your own shaders you can specify how to render object's pixels, on the older hardware you couldn't - you could just affect the parameters of GPU, probably, but shader (lightning calculation model - read, how to calculate pixels colors for an object) was the same for all objects.

PS. Shader program can affect not only fragments pixels, it can also specify how to affect fragment vertices and many more.
So you can create modulated surfaces and stuff like that.

PS2: Terms "shader" and "shader program" can be treated as synonyms.
How much better
As much as better as Half Life 2 looks better then HL1.
How do I try to build a Dreamcast toolchain:
Image
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: dreamcast games shaders?

Post by bogglez »

Every computer can make use of shaders, there is no need for hardware-support.
You can render the most realistic battlefield 4 scene on a Dreamcast (as long as you don't run out of memory), but you will not be able to do so in a reasonable time, that is the problem.
Hardware support for shaders only allows us to run those effects faster and create interactive scenes for games.
For example I have rendered the following picture on a Dreamcast. It's made by a very simple raytracer which uses shading, occlusion, refraction and reflection (not seen in this picture) and anti-aliasing, which are not supported by the Dreamcast hardware. The problem is that it does not render in a 1/60th of a second and therefore cannot be used in a game (except for generating a texture during a loading screen or something like that). I can add any effect that my math knowledge allows me.
raytrace.png
So the answer to your question is: it could look as amazing as you want it to be, but it would be slow (software-renderer) and therefore unusable.

The more interesting question would be: what kind of hardware support would have been realistic back then?
What effects would that hardware have allowed?
It would probably be something close to the Gamecube (limited).

The PS2 basically does shading in software, but it has really powerful CPUs that lend themselves to this task.

On the Dreamcast the graphics chip performs some tasks such as pixel/fragment shading, but we can not write full-fledged shaders, just change some attributes ("fixed-pipeline shading"). For example we can enable bump mapping.
The CPU does some other tasks, such as transforming the vertices/positions by matrices, which is what a vertex shader would do. Nowadays vertex shaders are done by the GPU which allows complex vertex shaders.
Since we have no hardware support for vertex transformation anyway, we could add _simple_ vertex shaders here, which don't strain the CPU too much.
This vertex shader would be realistic to implement for example: https://www.vertexshaderart.com/art/xvg4vyvfWjCvKZQfW
In this particular instance it is used to make the geometry adapt to the music. You could also make it do something in accordance to how much time has passed (some cool waterfall or lava effect maybe).

Geometry shaders are also reasonable in software. They generate geometry to be used by the vertex shader, and then later the fragment shader. But there is not much point in using them, since they're basically there to avoid a copy from CPU memory to GPU memory, which we have to do on the Dreamcast anyway.
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
Post Reply