Ray Casting Engine Demo_1

preview_player
Показать описание
This is a software rendered (Java) graphics engine I wrote recently that uses simple, classical ray casting. I've written other graphics engines, 2D and 3D, since I started programming in high school, but it's only recently that I have started getting good at planning my programs in such a way that allows them the potential to be used for real projects instead of just messy tech demos. I started this project around the start of August (will be exactly 2 weeks on Friday) and as of now I have the following features implemented:

-standard 'press and hold' or 'toggle' button support for various controls
-mouse aiming (only single monitor support at this time)
-dynamic fog system which allows variable density and strength fog of any color to be blended with a surface in space of any other color
-simple 'motion blur' (translucent frame buffer)
-changeable Field Of View (default FOV is 90º)
-two types of projection methods including the sort of "fish-eye" projection often observed in similar rendering constructs and a more "correct" projection (which preserves spatial linearity)
-collision detection (WIP)
-yaw and roll camera rotation
-camera bobbing
-graphic text output console system which utilizes a stack to dynamically allocate screen space (mostly for debugging purposes)
-a somewhat similar graphics canvas that contains a mini-map system that shows locations of walls relative to the camera, the current FOV, and line of sight
-non-axis aligned, arbitrarily angled walls

More to come (I hope to add wall, floor, ceiling, textures and multiple heights very soon)... Thanks for watching!
Рекомендации по теме
Комментарии
Автор

I know some of this may be obvious or intrusive, but i'd like to ask, should a raycast engine render in terms the rays? Ive heard of doing everything in rays when using solid colors. But i also heard that drawing walls with textures was easier done by figuring out key corners and using a method to stretch/scale a sprite manually... i also heard that, with sprites, each wall can be a cube or defined blockand you just drow a clolumn of pixels a certain height based on the angle and depth of the ray and the row/column line that the ray hits... does it have to use rays for ALL aspects of rendering, or can a ray caster use sprite scaling methods with walls too?

Also, just to ask really what does the render method really look like in code?
Cuz the best guess i got was:
you take a base ange (90) devide that by your width resolution (1024) and you shoot a new angle every frame at
Ray_angle = -45+ ((90/1024)*n)
Get_depth(ray angle)
Collision pixel (xy wall, xy player, player angle, ray_angle)
Draw_scaled pixel column (n, depth//used to figure placement and height//, collision pixelxy//used to see what column of pixels will render//)

lostchild