Skip to content

Instantly share code, notes, and snippets.

View trentpolack's full-sized avatar

Trent Polack trentpolack

View GitHub Profile
@trentpolack
trentpolack / particle-swarm-webgl-geometry-buffers-gpu-noise.markdown
Last active July 22, 2017 22:10
Particle Swarm (WebGL + Geometry Buffers + GPU Noise)

Particle Swarm (WebGL + Geometry Buffers + GPU Noise)

Just a whole bunch of particles being rendered through geometry buffers (and modified on the GPU); also working on some better GPU-accelerated noise.

hugs, trent

A Pen by Trent Polack on CodePen.

License.

#Quixel Megascans Bridge API ####Updated: Aug 19th, 2016

We have developed an API to fetch information from the Bridge. The following is an initial list of endpoints any software will be able to retrieve information from.

  • Megascans repository path
  • Zip folder paths
  • Get all assets (folder and json path)
  • Get selected assets (folder and json path)
  • Search results (folder and json path) against a string

#Quixel Megascans Scripting Reference ###Updated: Aug 19th, 2016

The Megascans Bridge allows the user to send assets from the Bridge to external applications. The Bridge currently supports the following tools:

  • 3DS Max
  • Marmoset Toolbag 2
  • Unity 3d
  • Unreal Engine 4
@trentpolack
trentpolack / InitializerSharedPtr.cpp
Last active November 11, 2017 07:55
Construction/Allocation-Time std::shared_ptr Initialization (for the case where your class doesn't have constructors with an empty argument list)
class InitializerSharedPtr
{
protected:
struct PrivateStruct
{
explicit PrivateStruct( int Irrelevant )
{ }
};
public:
@trentpolack
trentpolack / EnumerationType.h
Last active September 23, 2024 12:16
Enumerations in Unreal Engine 4
// Generally, developers in UE4 tend towards the following convention for enumerations:
UENUM( BlueprintType )
enum class ENoiseGeneratorCellularType : uint8
{
NGCT_Natural UMETA( DisplayName = "Natural" ),
NGCT_Euclidean UMETA( DisplayName = "Euclidean" ),
NGCT_Manhattan UMETA( DisplayName = "Manhattan" ),
NGCT_Max UMETA( Hidden )
};
@trentpolack
trentpolack / AccessorMacroGenerators.h
Last active January 26, 2018 19:48
Unreal Engine 4 -- Member Accessor Method Macros (NOTE: This does not result in the accessors being available for blueprint-use as they're not UFUNCTIONs).
// NOTE: This does not result in the accessors being available for blueprint-use as they're not UFUNCTIONs.
UCLASS( )
class URawr : public UObject
{
GENERATED_CLASS( )
protected:
float RawrValue;
@trentpolack
trentpolack / WorstThing.h
Last active December 27, 2017 22:58
Getting around a series of annoying issues (C++'s existence and UE4's syntactical quirks) through a lambda-as-function-pointer-with-arguments.
// Structure to define a lambda object, return type, and any arguments to pass into the lambda expression upon execution.
template< typename O, typename R, typename ... A >
struct LambdaExpression
{
O _object;
R( O::*_function )( A... ) const;
LambdaExpression( const O & object )
: _object( object ), _function( &decltype( _object )::operator() )
{ }
@trentpolack
trentpolack / HoudiniEngineRuntime.Build.cs
Last active December 31, 2017 18:15
Houdini Engine for Unreal (Improved Path Handling on Windows)
// [GIST NOTE] Added at the bottom of the existing class (for editor and runtime).
// Check the system environment variables for HOUDINI_PATH (instead of just hard-coded path searching like the default plugin does).
public static bool GetHoudiniPath( int PluginVersionMajor, int PluginVersionMinor, int PluginVersionPatch, out string HoudiniPathOut )
{
string version = null;
// Do the easy check: an environment variable I recommend to people (trent, 12/31/17).
HoudiniPathOut = System.Environment.GetEnvironmentVariable("HOUDINI_PATH", System.EnvironmentVariableTarget.User);
if ( !string.IsNullOrEmpty( HoudiniPathOut ) )
@trentpolack
trentpolack / MechPartDataBase.h
Last active July 3, 2018 22:29
A sample data structure and its corresponding UE4 object for easy JSON serialization/deserialization.
// FMechPartDataBase Data Structure.
// This structure is solely for serialization/deserialization purposes (it gets transferred to the UObject instance after that process is done).
USTRUCT( )
struct FMechPartDataBase_SerializationStructure
{
GENERATED_BODY( )
public:
FMechPartDataBase_SerializationStructure( )
: ConfigName( NAME_None )
@trentpolack
trentpolack / MovementComponent_TrentsHighlights.cpp
Last active August 4, 2024 09:42
The "Fun" to be had (i.e. a big rant) in writing a general-purpose physical movement component (compound colliders representing static and skeletal meshes and more, but still interacting with the world as a physical entity). NOTE: All comments in this gist are by me.
// Comments are left by me, not from the code.
// Because why not have a default set or make the method abstract or, really, anything but this. Luckily no one would ever
// think to use ::GetMaxSpeed as a divisor or anything.
inline float UMovementComponent::GetMaxSpeed() const
{
return 0.f;
}
// FUN FACT: UMovementComponent defines a plethora of methods for managing the maximum speed of a component. It does not,