jpcy / ioq3-renderer-bgfx Goto Github PK
View Code? Open in Web Editor NEWA renderer for ioquake3 that uses bgfx.
License: GNU General Public License v2.0
A renderer for ioquake3 that uses bgfx.
License: GNU General Public License v2.0
I'm enjoying the extra dynamic lights very much.
However there's something very strange with how the LG effect is rendered.
It's just a very narrow line now. Any idea what may be wrong ?
Thank you !
Hi, my fps drops to 2-8fps inside the red tongue mouth in q3dm1. Using the Visual Studio 2017 profiler I quickly figured out whats causing it:
vec3 Vertex::getNormal() const
{
#if 1
return vec3
(
bx::bitsToFloat(half_to_float(normal[0])),
bx::bitsToFloat(half_to_float(normal[1])),
bx::bitsToFloat(half_to_float(normal[2]))
);
#else
return vec3( 1, 0, 0 ); // this removes the fps drop to < 10 fps
#endif
}
And the half_to_float function is called quite some often when inside the red mouth:
Probably it would make more sense to just convert the short normal once and just return that calculated normal?
This is cool! 👍
I would like to link this project on "Who is using it?" section on main bgfx page: https://github.com/bkaradzic/bgfx#who-is-using-it, but I need screenshot. Ideally one that shows bgfx stats, since I assume it looks identical to default GL renderer from ioquake3. :)
Thanks!
I would like to compile the source as standalone q3 client if is possible please.
When I select DirectX 12 it crashes. I am using the current master ioquake3 debug x86 build with the latest bgfx renderer binary (x86).
DirectX 11 works fine.
When it is crashing you need to manually modify q3config.cfg to remove the "seta r_backend "d3d12"" line and then you can choose another one that does not crash.
Arch x86_64
premake-git 5.0.alpha2.r445.gb4bc07f-1
git clone https://github.com/jpcy/ioq3-renderer-bgfx
git clone https://github.com/bkaradzic/bgfx
git clone https://github.com/bkaradzic/bx
git clone https://github.com/ioquake/ioq3/
cd ioq3-renderer-bgfx/
premake5 gmake
Building configurations...
Running action 'gmake'...
Generated build/Makefile...
Generated build/bgfx.make...
Generated build/renderer_bgfx.make...
Generated build/shaderc.make...
Done (182ms).
cd build
make
==== Building bgfx (debug_native) ====
Creating obj/native/Debug/bgfx
bgfx.cpp
glcontext_wgl.cpp
image.cpp
renderdoc.cpp
renderer_d3d11.cpp
renderer_d3d12.cpp
renderer_d3d9.cpp
renderer_gl.cpp
renderer_null.cpp
renderer_vk.cpp
shader_dx9bc.cpp
shader_dxbc.cpp
shader_spirv.cpp
vertexdecl.cpp
Linking bgfx
==== Building shaderc (debug_native) ====
Creating obj/native/Debug/shaderc
ast_array_index.cpp
ast_expr.cpp
ast_function.cpp
ast_to_hir.cpp
ast_type.cpp
builtin_functions.cpp
builtin_types.cpp
builtin_variables.cpp
glcpp-lex.c
glcpp-parse.c
pp.c
glsl_lexer.cpp
glsl_optimizer.cpp
glsl_parser.cpp
glsl_parser_extras.cpp
glsl_symbol_table.cpp
glsl_types.cpp
hir_field_selection.cpp
ir.cpp
ir_basic_block.cpp
ir_builder.cpp
ir_clone.cpp
ir_constant_expression.cpp
ir_equals.cpp
ir_expression_flattening.cpp
ir_function.cpp
ir_function_can_inline.cpp
ir_function_detect_recursion.cpp
ir_hierarchical_visitor.cpp
ir_hv_accept.cpp
ir_import_prototypes.cpp
ir_print_glsl_visitor.cpp
ir_print_metal_visitor.cpp
ir_print_visitor.cpp
ir_rvalue_visitor.cpp
ir_stats.cpp
ir_unused_structs.cpp
ir_validate.cpp
ir_variable_refcount.cpp
link_atomics.cpp
link_functions.cpp
link_interface_blocks.cpp
link_uniform_block_active_visitor.cpp
link_uniform_blocks.cpp
link_uniform_initializers.cpp
link_uniforms.cpp
link_varyings.cpp
linker.cpp
loop_analysis.cpp
loop_controls.cpp
loop_unroll.cpp
lower_clip_distance.cpp
lower_discard.cpp
lower_discard_flow.cpp
lower_if_to_cond_assign.cpp
lower_instructions.cpp
lower_jumps.cpp
lower_mat_op_to_vec.cpp
lower_named_interface_blocks.cpp
lower_noise.cpp
lower_offset_array.cpp
lower_output_reads.cpp
lower_packed_varyings.cpp
lower_packing_builtins.cpp
lower_ubo_reference.cpp
lower_variable_index_to_cond_assign.cpp
lower_vec_index_to_cond_assign.cpp
lower_vec_index_to_swizzle.cpp
lower_vector.cpp
lower_vector_insert.cpp
lower_vertex_id.cpp
opt_algebraic.cpp
opt_array_splitting.cpp
opt_constant_folding.cpp
opt_constant_propagation.cpp
opt_constant_variable.cpp
opt_copy_propagation.cpp
opt_copy_propagation_elements.cpp
opt_cse.cpp
opt_dead_builtin_variables.cpp
opt_dead_builtin_varyings.cpp
opt_dead_code.cpp
opt_dead_code_local.cpp
opt_dead_functions.cpp
opt_flatten_nested_if_blocks.cpp
opt_flip_matrices.cpp
opt_function_inlining.cpp
opt_if_simplification.cpp
opt_minmax.cpp
opt_noop_swizzle.cpp
opt_rebalance_tree.cpp
opt_redundant_jumps.cpp
opt_structure_splitting.cpp
opt_swizzle_swizzle.cpp
opt_tree_grafting.cpp
opt_vectorize.cpp
s_expression.cpp
standalone_scaffolding.cpp
strtod.c
imports.c
prog_hash_table.c
symbol_table.c
hash_table.c
ralloc.c
vertexdecl.cpp
cpp1.c
cpp2.c
cpp3.c
cpp4.c
cpp5.c
cpp6.c
shaderc.cpp
In file included from /usr/include/c++/5.3.0/unordered_map:35:0,
from ../code/shaderc/shaderc_p.h:50,
from ../code/shaderc/shaderc.cpp:7:
/usr/include/c++/5.3.0/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
../code/shaderc/shaderc.cpp:227:15: error: ‘unordered_map’ in namespace ‘std’ does not name a template type
typedef std::unordered_map<std::string, Varying> VaryingMap;
^
../code/shaderc/shaderc.cpp: In function ‘bool shaderc::compileShader(const shaderc::CompileShaderParameters&)’:
../code/shaderc/shaderc.cpp:997:4: error: ‘VaryingMap’ was not declared in this scope
VaryingMap varyingMap;
^
../code/shaderc/shaderc.cpp:1104:7: error: ‘varyingMap’ was not declared in this scope
varyingMap.insert(std::make_pair(var.m_name, var) );
^
../code/shaderc/shaderc.cpp:1531:8: error: ‘VaryingMap’ is not a class or namespace
VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
^
../code/shaderc/shaderc.cpp:1532:12: error: ‘varyingIt’ was not declared in this scope
if (varyingIt != varyingMap.end() )
^
../code/shaderc/shaderc.cpp:1532:25: error: ‘varyingMap’ was not declared in this scope
if (varyingIt != varyingMap.end() )
^
../code/shaderc/shaderc.cpp:1561:8: error: ‘VaryingMap’ is not a class or namespace
VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
^
../code/shaderc/shaderc.cpp:1562:12: error: ‘varyingIt’ was not declared in this scope
if (varyingIt != varyingMap.end() )
^
../code/shaderc/shaderc.cpp:1562:25: error: ‘varyingMap’ was not declared in this scope
if (varyingIt != varyingMap.end() )
^
../code/shaderc/shaderc.cpp:1647:9: error: ‘VaryingMap’ is not a class or namespace
VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
^
../code/shaderc/shaderc.cpp:1648:13: error: ‘varyingIt’ was not declared in this scope
if (varyingIt != varyingMap.end() )
^
../code/shaderc/shaderc.cpp:1648:26: error: ‘varyingMap’ was not declared in this scope
if (varyingIt != varyingMap.end() )
^
../code/shaderc/shaderc.cpp:1754:9: error: ‘VaryingMap’ is not a class or namespace
VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
^
../code/shaderc/shaderc.cpp:1755:13: error: ‘varyingIt’ was not declared in this scope
if (varyingIt != varyingMap.end() )
^
../code/shaderc/shaderc.cpp:1755:26: error: ‘varyingMap’ was not declared in this scope
if (varyingIt != varyingMap.end() )
^
../code/shaderc/shaderc.cpp:1771:9: error: ‘VaryingMap’ is not a class or namespace
VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
^
../code/shaderc/shaderc.cpp:1772:13: error: ‘varyingIt’ was not declared in this scope
if (varyingIt != varyingMap.end() )
^
../code/shaderc/shaderc.cpp:1772:26: error: ‘varyingMap’ was not declared in this scope
if (varyingIt != varyingMap.end() )
^
../code/shaderc/shaderc.cpp:1787:9: error: ‘VaryingMap’ is not a class or namespace
VaryingMap::const_iterator varyingIt = varyingMap.find(*it);
^
../code/shaderc/shaderc.cpp:1788:13: error: ‘varyingIt’ was not declared in this scope
if (varyingIt != varyingMap.end() )
^
../code/shaderc/shaderc.cpp:1788:26: error: ‘varyingMap’ was not declared in this scope
if (varyingIt != varyingMap.end() )
^
shaderc.make:681: recipe for target 'obj/native/Debug/shaderc/shaderc.o' failed
make[1]: *** [obj/native/Debug/shaderc/shaderc.o] Error 1
Makefile:64: recipe for target 'shaderc' failed
make: *** [shaderc] Error 2
using plasma gun cause gpu usage 100% on ubuntu16.04, which cause tag
Is there any intent on adding new features to this renderer? Maybe higher resolution lightmaps, PBR?
Testing this renderer with UrbanTerror. tested precompiled, and my own compile, getting crash with a few weapons. Can work around by not showing weaps with cg_drawhands
Maybe some bgfx recent updates resolved this? tty]../code/bgfx/src/renderer_gl.cpp (4826): BGFX Texture2D 744: RGBA8 (requested: RGBA8), layers 1, 256x256x0.
Hello, thank you for this nice project ! I test your excellent render on openarena game, which very similar to quake 3 arena but still have small difference in shader material construction. My problem is that the rocket explosion visual effect not rendered correctly. I attached a picture
to illustrate the case:
After debugging a while, I find that it may caused by animmap
not handled correctly.
rocketExplosion
{
{
animmap 8 models/weaphits/rlboom/rlboom_1.tga models/weaphits/rlboom/rlboom_2.tga models/weaphits/rlboom/rlboom_3.tga models/weaphits/rlboom/rlboom_4.tga models/weaphits/rlboom/rlboom_5.tga models/weaphits/rlboom/rlboom_6.tga models/weaphits/rlboom/rlboom_7.tga models/weaphits/rlboom/rlboom_8.tga
blendfunc gl_one gl_src_alpha
rgbGen wave inversesawtooth 0 1 0 8
}
{
animmap 8 models/weaphits/rlboom/rlboom_2.tga models/weaphits/rlboom/rlboom_3.tga models/weaphits/rlboom/rlboom_4.tga models/weaphits/rlboom/rlboom_5.tga models/weaphits/rlboom/rlboom_6.tga models/weaphits/rlboom/rlboom_7.tga models/weaphits/rlboom/rlboom_8.tga models/weaphits/rlboom/rlboom_8.tga
blendfunc gl_one gl_src_alpha
rgbGen wave sawtooth 0 1 0 8
}
{
clampmap textures/oa/fiar.tga
blendfunc add
rgbGen wave inversesawtooth 0.1 0.8 0 1
tcMod rotate 77
tcMod stretch inversesawtooth 0.1 1 0 0.4
}
{
clampmap textures/oa/fiar2.tga
blendfunc add
rgbGen wave inversesawtooth 0 1 0 1
tcMod rotate 33
tcMod stretch sin 0.2 1 0 0.4
}
{
clampmap textures/oa/fiar.tga
blendfunc add
rgbGen wave sin 0 1 0 1
tcMod rotate -17
tcMod stretch sawtooth 0.1 1.5 0 1
}
{
clampmap textures/oa/fiar.tga
blendfunc add
rgbGen wave inversesawtooth 0.1 1 0 1
tcMod rotate -77
tcMod stretch sawtooth 0.4 0.8 0 1
}
}
I have no idea how to handle this as i am not familiar with bgfx, so I decide report to you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.