Commit graph

520 commits

Author SHA1 Message Date
marauder2k7
39c2cc09fc Update gfxGLShader.h
forgot to save the file...
2024-03-06 14:02:30 +00:00
marauder2k7
4a6fbd5811 DX and GL Geometry shaders added
Added the dx and gl geometry shader compile codes.
2024-03-06 13:51:50 +00:00
marauder2k7
808e2f4200 Groundwork for other shaders
Adds the ground work for geometry shaders
Expands shaderData and gfxShader to allow for more shader types

note: when building a GFXShader in source you have to call setShaderStageFile with the shaderStage and the filepath for that stage.

Once we add compute shaders this will become more apparent as compute shaders are a stage of their own and do not require vertex and pixel files whereas other shaders sometimes do.
2024-03-06 13:26:39 +00:00
marauder2k7
d8636f754b Merge remote-tracking branch 'upstream/development' into ShaderConstBuffer-CleanupRefactor 2024-03-01 17:52:37 +00:00
marauder2k7
6355da5df6 various fixes
STB probably shouldn't fail on failed info, just continue.
Assimp only add sequences if there are any.
Update kork chan asset.
2024-03-01 15:01:47 +00:00
marauder2k7
017246cfa3 Update gfxD3D11Shader.cpp 2024-03-01 14:30:31 +00:00
marauder2k7
cd6656be35 Fix archive
Incorrect cmake directory was messing up reading from zips
STB was failing to read from zips, it was failing to get the file info, something we were using as an early out, now if that files on the filepath, we use the memory read instead since stream needs to be a success to get to that point.
2024-03-01 10:06:18 +00:00
marauder2k7
a7021c0ed3 cleanup
Reverted back to a 2d array since when the const buffer changes are made to the shaders they will be completely swapped out for a 1d array with a max size of 16 for the program, id3d11buffers will be shared across shaders apart from object buffers. We still need to decide on a structure to get everything setup so to keep functionality a max of 2 buffers per stage with 1 buffer as a padding so we can start coding constant buffers right away
2024-02-29 14:34:22 +00:00
marauder2k7
cd8914b9ad reverse bitshift
need to reverse the bitshift on shaderstages so we get values between 0-5, need to also revert the mBoundConstVec back to a 2dimensional array so that the binding point can be dynamic as well.
2024-02-27 20:59:10 +00:00
marauder2k7
040bbdd6d6 Update gfxD3D11Shader.cpp
turns out we dont need to do this if both exist the bind point gets changed anyway
2024-02-27 14:51:59 +00:00
marauder2k7
e9a38539a3 multiple desc per handle
Added multiple descriptions to handles.

While maps are very efficient and match data very quickly due to hashing and what not, they are tricky memory wise, we cant clear them if they are only made up of structs and enums. Need to explore other methods for doing this. Original system had a sub buffer system with a check based on whether the handle was marked vertex/pixel. With 6 stages possible now we need to think of a more effective method. Since shaderstage is now a bit flag maybe some sort of streaming setup could be used to write without a loop.
2024-02-27 09:15:19 +00:00
marauder2k7
78df01af55 Update gfxD3D11Shader.cpp
plugging leaks
2024-02-26 22:44:32 +00:00
marauder2k7
37636bcd26 switch to vectors
uses vectors for buffers instead of 2d array
2024-02-26 22:25:11 +00:00
marauder2k7
c876e86957 Update gfxD3D11Shader.cpp
cleanups
2024-02-26 16:38:56 +00:00
marauder2k7
b979f4befc everything works
... apart from the sun =/
2024-02-26 09:22:19 +00:00
marauder2k7
e24971517e commit before pr 2024-02-25 23:10:23 +00:00
marauder2k7
25bc9cf354 stumped
buffers seem to be being added correctly, but for whatever reason render is not correct =/
2024-02-25 22:51:37 +00:00
marauder2k7
af29a2af0a Remove code duplication
Removed code duplication, all types can be routed through the same function apart from matrices.
2024-02-25 15:26:48 +00:00
marauder2k7
8c01a1a85b Working
This commit has everything rendering kind of correctly, but the colours seem off from lighting.
2024-02-25 13:39:22 +00:00
marauder2k7
6355e122d2 compare before change
check to see if data is different in internal sets before changing values
2024-02-24 19:52:35 +00:00
marauder2k7
3f3ef12c3b handle the global buffer
global buffer needs a special case
2024-02-24 17:33:28 +00:00
marauder2k7
e8d8138c74 working
last commit before global conform
2024-02-24 16:26:09 +00:00
marauder2k7
8887e21f4b working
working example, renders all gui controls.

We still cant render a scene, something to do with the constant buffer at slot 0 of the vertex shader being too small..... gotta figure this one out..................
2024-02-24 14:42:30 +00:00
marauder2k7
dd4d48d654 working example
now its working.. still not perfect but its getting there
2024-02-24 12:40:12 +00:00
marauder2k7
42b8748f5b bkup
still memory heap issue
2024-02-24 12:04:53 +00:00
marauder2k7
4caa54ad7e working example
everything is working apart from samplers......
2024-02-23 21:27:44 +00:00
marauder2k7
a1e2f781a8 Set constant buffers
added logic to set constant buffers dx side
2024-02-23 20:06:46 +00:00
marauder2k7
97ed522667 gfxD3D handles and buffermap
init handles coded.
bufferMap added.
2024-02-23 17:18:45 +00:00
marauder2k7
630bee97c7 backup 2024-02-22 21:37:44 +00:00
marauder2k7
55519aac57 Shader refactor
Refactored DX Shader compilation and reflection to be more similar to opengl
Added support for more than 1 const buffer per shader stage.

This is boilerplate code, no functionality yet, that will be added in further commits. Though this builds without errors do not try and run it at this point.
2024-02-22 09:58:45 +00:00
marauder2k7
ad64b4f2df IES Loader
Updated IES loader to use torque math functions and calls in the problem areas for mac and linux.

New F32_MIN_EX which is lower than F32_MIN (required for ies profiles)
2024-02-21 09:36:37 +00:00
marauder2k7
a12d915180 Loads an IES Photometric profile.
ADDED: Ability to add IES profile as the cookie texture slot in both point lights and spot lights

TODO:
Have the IES Profile also drive the settings for the lights.
Make it work with Cookie textures. IES profiles are to be another slot in the advanced light section.
2024-02-21 06:22:37 +00:00
marauder2k7
d87199f5da Final Cleanup
-Removed LPNG
-Removed LJPEG
-Re-Added DefferredPNGWriter from rextimmy stb work

Commented out lines about file saving and reading in gfont, these are good for debugging font saves.
2024-01-23 08:47:26 +00:00
marauder2k7
8632468a9c Set format in read stream
Forgot to pass the decided format in read from stream
2024-01-21 20:10:29 +00:00
marauder2k7
43c2c918c7 Expanded Features
Added ability to set format dynamically on read from stream.
Added other formats to write to a stream.
2024-01-20 22:47:58 +00:00
marauder2k7
106346630d STB Memory functions for fonts
Add the ability to read and write to a stream.
2024-01-20 22:15:17 +00:00
marauder2k7
7216ba8530 Revert "revert #1148 as prematurely incorporated"
This reverts commit f946088214.
2024-01-20 18:01:57 +00:00
AzaezelX
f946088214 revert #1148 as prematurely incorporated
it's getting there, but there have been a few spots noted where it eroneously corrupts text, so we'll have to pull this back out for a bit barring a proper resolution
2024-01-11 13:33:03 -06:00
Brian Roberts
51426a3575
Merge pull request #1148 from marauder2k9-torque/STBImageLoading-PR
Stb image loading
2024-01-01 08:48:46 -06:00
AzaezelX
1f837304ea theoratexture can't downsample
so don't.
this stops $pref::Video::textureReductionLevel from crashing the applicaton in that scenario
2023-12-19 13:15:12 -06:00
marauder2k7
89a8a4d190 Merge remote-tracking branch 'upstream/development' into STBImageLoading-PR 2023-12-08 04:29:41 +00:00
AzaezelX
8c38448428 probe capture fixes
review of per and post bake protocols showed that the CAPTURING shader macro was not being properly recompiled in. as opengl was not playing nice with a simple batch shader recompilation for all effected shaders, a full lightmanager restart is at time of writing required. once we have a proper globally cached scene structure stored off GPU side, we'll want to change  GFXShader::addGlobalMacro("CAPTURING", String("1")); on over to dirtying that value in the cached buffer via setting a shader global uniform
review of prefilter examples shows a fixed sample count of 1024 across multiple implementations, so we'll use the standard barring further research into where that number is comming from for a scalar approach
review of gl shaders shows a doubleup in compiled state testing, so slimmed that down and added additional debugging reports
2023-12-05 13:32:03 -06:00
marauder2k7
5f8c59a8df MacOSX fixes 2023-12-04 00:16:07 +00:00
marauder2k7
a91b19d4dc Added hdr and bypass 16bit when png.
Added support for .hdr format, atm just being converted to ldr after the exposure is applied.

cleanup dds file

PNG skips 16bit altogether at the moment for textureArray issues.
2023-12-01 14:50:59 +00:00
marauder2k7
c18c14b415 Update gBitmap.h
typo
2023-11-30 15:58:41 +00:00
marauder2k7
6ed0374768 Added documentation
CompressionLevel argument now used to set jpeg quality as well. Values need to be 0-100 range for jpeg and 0-10 for png.
2023-11-30 15:57:59 +00:00
marauder2k7
870fae3e47 Update screenshot.cpp
Screenshot now works with stb: gBitmap outbuffer holds the whole image anyway so just use writeBitmap when its done.
2023-11-30 14:02:06 +00:00
marauder2k7
63682c43ec Bug fixes:
Generating image previews of image assets was failing

DDS remove redundant check for stream status.

STB requires the file to be free before being written to, move check to make sure we can open the path into gBitmap and remove FileStream checks from everywhere else.
2023-11-30 10:46:51 +00:00
marauder2k7
108ba34c08 STBImage
STB used for loading and writing images.
2023-11-30 09:09:13 +00:00
Lukas Aldershaab
89b0c7f73b Console Refactor 2023-09-13 10:33:20 +02:00