OpenTechEngine / Discussions

The issues of this project are abused as a discussion forum for Open Tech
4 stars 0 forks source link

Renderprogs #24

Closed ghost closed 8 years ago

ghost commented 9 years ago

I've been trying out modded versions of the renderprogs, not sure if the engine is loading the files correctly, it's not showing any changes or adding any new effects. I'm mainly trying to get SSAO in the engine. Even deleting the folder the engine runs fine without change. I've also used resourceLoadPriority. Is the vertex/pixel shader code hardcoded into the engine as well?

BielBdeLuna commented 9 years ago

the CG code or the old .vp .fp code? I think now IdTechX ignores the old code

kortemik commented 9 years ago

https://developer.nvidia.com/cg-toolkit-download

ghost commented 9 years ago

Sorry for the late reply, was without internet for a while. I noticed the engine writes glsl code to the user save game folder. I think it may be hard coded and linked to the vertex and pixel files in the renderprogs folder.

The code I have is based on modern OpenGL, the tutorial was aimed at OpenGL 3.3 using a similar technique to the SSAO used in Crysis. my goal is just to get custom GL programs to run with the engine.

I'll download the CG toolkit, used it a while ago. Thinking of getting hold of the OpenGL super bible to learn more. Would be interesting if we could get 3D volumetric textures into the engine as well, which I've only seen fully used in medical software, but could prove useful for some effects like clouds or possibly realistic scattering effects.

Anthony-Gaudino commented 9 years ago

@Yetta1 I think you will need to rewrite the shader into CG for it to work. I know that the CG shader will be compiled to GLSL for you, but I imagine you must change some code to integrate the new shader into the pipeline and to do this you would need to rewrite it in CG.

Another option would be to change the engine to use GLSL shaders directly, but then you would need to change some code anyway.

CG is not maintained anymore since 2012, and GLSL offers many new features that code generated by the CG compiler will never make use of.

It seems that you can find GLSL code easier on the Internet, I really liked this rendering pipeline for Panda 3D: https://github.com/tobspr/RenderPipeline/ which requires OpenGL 4.3+. If we could get results like this it would be a huge boost on graphics quality.

ghost commented 9 years ago

I noticed the issue of CG and the GLSL generation, for PBS materials we need OpenGL 3.3 or higher it seems. I've been doing a lot of reading on the subject of physically based shading, it seems that data for roughness, gloss, albedo etc is stored in the RGB channels.

Another issue is the lack of relief/tesselation in the shaders, adding more detail will help make shaders more believable as it's needed for light to reflect correctly, whereas normals are insufficient.

I've been hacking around with the material scripts to blend real-time reflections and cube maps with the specular maps etc. Some of it worked a bit with terrible performance, dropping to 2fps while other ways created artifacts. It's also very difficult to create materials with some form of global illumination or light as the ambient light seems to drown out normal maps making it look diffuse.

BielBdeLuna commented 9 years ago

I don't think we should need any superior version of OpenGL for PBS since the engine already does use the roughness, although it does it as a constant, we just have to be able to change it, we could sue a new bitmap for that, or a single value in the shader. (so we should be able to read it in either two forms, or at least one for starters)

we could try to add to the engine the ARB to GLSL and compile the old relief shaders, and then study what they do, we could make a dev function to create glsl shaders out of whatever there is in a folder, in fact I think RBDoom3BFG still have the ARB system in place albeit deactivated. when I went into this CG->GLSL stuff I saw some stuff related to ARB, maybe it was creation of ARB shaders and not reading, but maybe we can import Doom3's original method?

ghost commented 9 years ago

@BielBdeLuna I think a lot of Doom 3 modders will be happy if ARB works in RB and OTE as there seems to have been a lot of complaints surrounding it especially people that wanted to play sikkmod on BFG but couldn't since all the shaders where ARB. Sikkmod's ARB shaders do perform well on lower end hardware if tweaked right, however does have some graphical artifacts at times.

I recently watched the Blender Conference 2015 videos, Ton Roosendaal said that PBS and Vulkan is planned for Blender 2.8 and it's game engine. Maybe we can have cross-compatibility so that whatever is made in Blender will look exactly the same in OTE. Possibly a importer/exporter that creates a directory and saves out all the materials, shaders, effects, scripts, models and animations.

BielBdeLuna commented 8 years ago

with the recent stage of RBDoom3BFG this discussion has become moot point isn't it?

ghost commented 8 years ago

We can close this since there are add-ons being developed for Blender now by you guys, which I am extremely grateful for. Blenders material output is already close to what it seen in the engine. Agree to close?

BielBdeLuna commented 8 years ago

yes